### Question:
Element implements Comparable<Element> { @SuppressWarnings({"PMD.ShortMethodName"}) public final Object id() { if (userSuppliedId != null) { return userSuppliedId; } if (delegate != null) { return delegate.id(); } return null; } 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 testWithIdTraversal() { Element element = createElement(); traverse(element.withId); verify(traversal, times(1)).hasId(element.id()); }