the code:
public class Name {
private String[] name;
private String first;
private String middle;
private String last;
private String suffix;
public Name (String fullName) {
parse1();
parse2();
parse3();
}
private void parse1() {}
private void parse2() {}
private void parse3() {}
These methods below the constructor help to parse fullName. I want to move these methods parse#()to another class, say NameHelper.classand do everything there public static, but something inside me says that it is useless for refactoring, since it will not use another class, but Name.
I want to reorganize, because later it will be really difficult to unit test. But I don’t want to sacrifice testing with ease against refactoring bad code, because I could always use PowerMockitoprivates to check.
source
share