@Test public void testSeparator() { assertThat(PersonNameBuilder.separator(null, null), isEmptyString()); assertThat(PersonNameBuilder.separator(Type.FORENAME, null), isEmptyString()); assertThat(PersonNameBuilder.separator(null, Type.SURNAME), isEmptyString()); assertThat(PersonNameBuilder.separator(Type.FORENAME, Type.SURNAME), equalTo(" ")); assertThat(PersonNameBuilder.separator(Type.SURNAME, Type.FORENAME), equalTo(", ")); }
@VisibleForTesting static String separator(PersonNameComponent.Type type1, PersonNameComponent.Type type2) { if (type1 == null || type2 == null) { return EMPTY; } else { String value = separators.get(new MultiKey(type1, type2)); return (value != null) ? value : SPACE; } }
PersonNameBuilder { @VisibleForTesting static String separator(PersonNameComponent.Type type1, PersonNameComponent.Type type2) { if (type1 == null || type2 == null) { return EMPTY; } else { String value = separators.get(new MultiKey(type1, type2)); return (value != null) ? value : SPACE; } } }
PersonNameBuilder { @VisibleForTesting static String separator(PersonNameComponent.Type type1, PersonNameComponent.Type type2) { if (type1 == null || type2 == null) { return EMPTY; } else { String value = separators.get(new MultiKey(type1, type2)); return (value != null) ? value : SPACE; } } PersonNameBuilder(); }
PersonNameBuilder { @VisibleForTesting static String separator(PersonNameComponent.Type type1, PersonNameComponent.Type type2) { if (type1 == null || type2 == null) { return EMPTY; } else { String value = separators.get(new MultiKey(type1, type2)); return (value != null) ? value : SPACE; } } PersonNameBuilder(); void addComponent(PersonNameComponent component); String getName(); }
PersonNameBuilder { @VisibleForTesting static String separator(PersonNameComponent.Type type1, PersonNameComponent.Type type2) { if (type1 == null || type2 == null) { return EMPTY; } else { String value = separators.get(new MultiKey(type1, type2)); return (value != null) ? value : SPACE; } } PersonNameBuilder(); void addComponent(PersonNameComponent component); String getName();  }