### Question:
Element implements Comparable<Element> { public final String label() { return Label.of(getClass()); } Element(Element other); final String label(); @SuppressWarnings({"PMD.ShortMethodName"}) final Object id(); @SneakyThrows @SuppressWarnings({"PMD.ShortMethodName"}) ElementTo.Element s(String key); void validate(); static void cache(long numberOfElements); @Override boolean equals(Object other); @Override @SneakyThrows int hashCode(); @Override int compareTo(Element that); boolean existsIn(Collection<? extends Element> elements); @SuppressWarnings("unchecked") static final Comparator<Element> valuesOf(List<Field> fields); static final long serialVersionUID; final ElementTo.Element withLabel; final ElementTo.Element withId; }### Answer:
@Test public void testWithLabelTraversal() { Element element = createElement(); traverse(element.withLabel); verify(traversal, times(1)).hasLabel(element.label()); }
@Test public void testLabelExists() { Element element = createElement(); assertEquals(Label.of(element), element.label()); }