@SuppressWarnings("unchecked")
@Test
public void testCompareGraphsForNotEmptyExpectedGraphButEmptyGivenGraph() throws Exception {

    // GIVEN
    final Node a = graphElementFactory.createNode("a", Arrays.asList("A"),
            ImmutableMap.<String, Object>builder().put("id", 1l).build());
    final Node b = graphElementFactory.createNode("b", Arrays.asList("B"),
            ImmutableMap.<String, Object>builder().put("id", 2l).build());
    final Edge e = graphElementFactory.createEdge(a, b, "e", Arrays.asList("E"), Collections.emptyMap());
    final Graph<Node, Edge> expectedGraph = createGraph(Arrays.asList(a, b), Arrays.asList(e));
    final Graph<Node, Edge> givenGraph = createGraph(Collections.emptyList(), Collections.emptyList());
    final GraphComparator comparator = new GraphComparator(graphElementFactory, new String[] {}, false);
    when(dbReader.readGraph(connection)).thenReturn(givenGraph);
    // WHEN
    comparator.compare(connection, expectedGraph, errorCollector);
    // THEN
    final ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class);
    verify(errorCollector, times(5)).collect(stringCaptor.capture());
    final List<String> capturedMessages = stringCaptor.getAllValues();
    assertThat(capturedMessages,
            hasItems(containsString("Nodes with A labels were expected to be present, but not found"),
                    containsString("Nodes with B labels were expected to be present, but not found"),
                    containsString(a.asString() + " was expected, but is not present"),
                    containsString(b.asString() + " was expected, but is not present"),
                    containsString(e.asString() + " was expected, but is not present")));
}