Dependency extends AbstractGraphElement { @Override public String toString() { return format("%s --[%s]--> %s", source.getName(), dependencyType.name(), target.getName()); } Dependency(Node source, Node target, DependencyType dependencyType); Node getSource(); Node getTarget(); DependencyType getDependencyType(); void setDependencyType(DependencyType dependencyType); void addBaseDependency(Dependency baseDep); Set<Dependency> getBaseDependencies(); @Override String toString();  }
@Test public void testToString() { Node n1 = new Node("n1"); Node n2 = new Node("n2"); Dependency dependency = new Dependency(n1, n2, DependencyType.CREATE); assertThat(dependency.getDependencyType(), is(DependencyType.CREATE)); assertThat(dependency.toString(), is("n1 --[CREATE]--> n2")); }