@Test
public void shouldNotAllowToAddSelfAsDependency() {

    final Graph graph = new Graph();
    final Node<String> node = new Node<>(String.class);
    try {
        graph.addEdge(node, node);
        fail("It should have thrown an IllegalArgumentException");
    } catch (Exception e) {
        assertThat(e, instanceOf(IllegalArgumentException.class));
    }
}