### Question:
ElementName implements Serializable, Comparable<ElementName> { public static ElementName fromString(final String clazz) { return new ElementName(clazz); } ElementName(final String name);  ElementName(final String name, final boolean intern);  ElementName(final Class<?> clazz); static ElementName fromString(final String clazz); static ElementName fromClass(final Class<?> clazz); String asJavaName(); String asInternalName(); ElementName getNameWithoutPackage(); ElementName getParent(); ElementName withoutPrefixChars(final int prefixLength); ElementName withoutSuffixChars(final int suffixLength); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); int compareTo(final ElementName o);  }### Answer:
@Test public void shouldSortByName() { final ElementName a = ElementName.fromString("a.a.c"); final ElementName b = ElementName.fromString("a.b.c"); final ElementName c = ElementName.fromString("b.a.c"); final List<ElementName> actual = Arrays.asList(b, c, a); assertThat(actual).containsExactlyInAnyOrder(a, b, c); }
@Test public void shouldTreatSameClassAsEqual() { assertThat(ElementName.fromString("org/example/Foo")).isEqualTo(ElementName.fromString("org.example.Foo")); }
@Test public void shouldTreatDifferentClassesAsNotEqual() { assertThat(ElementName.fromString("org/example/Foo")).isNotEqualTo(ElementName.fromString("org.example.Bar")); }