Code:
public class Name {
private String[] name;
private String first;
private String middle;
private String last;
private String suffix;
public Name (String fullName) {
//Name is parsed in constructor
parse1();
parse2();
parse3();
//invoking more parse methods...
}
private void parse1() {}
private void parse2() {}
private void parse3() {}
//more parse methods...
Those methods below the constructor help parse the fullName
. I want to move these parse#()
methods to another class, say NameHelper.class
and make everything there public static
but something inside me says that it's useless to refactor like that since not other class but Name
will use it.
I do want to refactor because later on, this would be really difficult to unit test. But I don't want to sacrifice testing with ease vs. bad code refactoring because I could always use PowerMockito
to test privates.