### Question:
JavaName { public String toConstantName() { if (words.isEmpty()) { return EMPTY_NAME; } return toSnakeName().toUpperCase(Locale.ENGLISH); } JavaName(List<String> words); static JavaName of(String nameString); List<String> getSegments(); String toTypeName(); String toMemberName(); String toConstantName(); String toSnakeName(); void addFirst(String segment); void removeFirst(); void addLast(String segment); void removeLast();  }### Answer:
@Test public void toConstantName() { JavaName name = JavaName.of("OneTwoThreeFour"); assertThat(name.toConstantName(), is("ONE_TWO_THREE_FOUR")); }