### Question:
LogEntryFactory { public LogEntry createForVertex(Vertex vertex) { Iterator<Vertex> previous = vertex.vertices(Direction.IN, "VERSION_OF"); if (previous.hasNext()) { return new UpdateVertexLogEntry(vertex, previous.next()); } return new CreateVertexLogEntry(vertex); } LogEntryFactory(); LogEntry createForVertex(Vertex vertex); LogEntry createForEdge(Edge edge);  }### Answer:
@Test public void createForVertexCreatesACreateVertexLogEntry() { Vertex vertex = vertex().build(); LogEntryFactory instance = new LogEntryFactory(); LogEntry entry = instance.createForVertex(vertex); assertThat(entry, is(instanceOf(CreateVertexLogEntry.class))); }
@Test public void createForVertexCreatesAnUpdateVertexLogEntryIfTheVertexHasIncomingVersionOfEdges() { Vertex vertex = vertex().withIncomingRelation("VERSION_OF", vertex().build()).build(); LogEntryFactory instance = new LogEntryFactory(); LogEntry entry = instance.createForVertex(vertex); assertThat(entry, is(instanceOf(UpdateVertexLogEntry.class))); }