@Test
public void testAddBaseDependency() {

    Node n1 = new Node("n1");
    Node n2 = new Node("n2");
    Dependency dependency = new Dependency(n1, n2, DependencyType.CREATE);
    assertThat(dependency.getBaseDependencies().isEmpty(), is(true));
    Node n3 = new Node("n3");
    Node n4 = new Node("n4");
    Dependency dep2 = new Dependency(n3, n4, DependencyType.READ_ONLY);
    dependency.addBaseDependency(dep2);
    assertThat(dependency.getBaseDependencies(), hasSize(1));
    Node n5 = new Node("n5");
    Node n6 = new Node("n6");
    Dependency dep3 = new Dependency(n5, n6, DependencyType.READ_WRITE);
    dependency.addBaseDependency(dep3);
    assertThat(dependency.getBaseDependencies(), hasSize(2));
    dependency.addBaseDependency(dep2);
    assertThat(dependency.getBaseDependencies(), hasSize(2)); // only added once.
    // another edge between the same nodes is added:
    Dependency dep2b = new Dependency(n3, n4, DependencyType.READ_WRITE);
    dependency.addBaseDependency(dep2b);
    assertThat(dependency.getBaseDependencies(), hasSize(3));
}