### Question:
HasKeys implements ElementTo.Element { @SuppressWarnings("PMD.ShortMethodName") public static HasKeys of(org.apache.tinkerpop.gremlin.object.structure.Element element, Class<? extends Annotation> keyType) { return HasKeys.builder() .element(element) .keyType(keyType) .build(); }  @SuppressWarnings("PMD.ShortMethodName") static HasKeys of(org.apache.tinkerpop.gremlin.object.structure.Element element,
      Class<? extends Annotation> keyType); @Override @SneakyThrows GraphTraversal<Element, Element> apply(GraphTraversal<Element, Element> traversal);  }### Answer:
@Test public void testHasPrimaryKeyTraversal() { HasKeys hasKeys = HasKeys.of(sanFrancisco); traverse(hasKeys); verify(traversal, times(1)).hasLabel("City"); verify(traversal, times(1)).has("name", "San Francisco"); assertEquals(sanFrancisco, hasKeys.element()); }
@Test(expected = IllegalArgumentException.class) public void testNullPrimaryKeyTraversal() { sanFrancisco.setName(null); HasKeys hasKeys = HasKeys.of(sanFrancisco); traverse(hasKeys); }