### Question:
IdIndexChangeListener implements ChangeListener { @Override public void onCreate(Collection collection, Vertex vertex) { indexHandler.upsertIntoIdIndex(UUID.fromString(vertex.value("tim_id")), vertex); } IdIndexChangeListener(IndexHandler indexHandler); @Override void onCreate(Collection collection, Vertex vertex); @Override void onPropertyUpdate(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onRemoveFromCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onCreateEdge(Collection collection, Edge edge); @Override void onEdgeUpdate(Collection collection, Edge oldEdge, Edge newEdge);  }### Answer:
@Test public void onCreateAddsTheVertexToTheIdIndex() { UUID timId = UUID.randomUUID(); Vertex vertex = vertexWithId(timId); IndexHandler indexHandler = mock(IndexHandler.class); IdIndexChangeListener instance = new IdIndexChangeListener(indexHandler); instance.onCreate(NULL_COLLECTION, vertex); verify(indexHandler).upsertIntoIdIndex(timId, vertex); }