public void addEdge(Dependency dependency){
  if (!edges.contains(dependency)) {
    edges.add(dependency);
    Set<Dependency> outboundEdges=vertices.get(dependency.getDepender());
    if (outboundEdges == null) {
      outboundEdges=new HashSet();
      vertices.put(dependency.getDepender(),outboundEdges);
    }
    outboundEdges.add(dependency);
    if (vertices.get(dependency.getDependsOn()) == null) {
      vertices.put(dependency.getDependsOn(),new HashSet());
    }
  }
}

public void addEdge ( Dependency dependency ) { if ( ! edges . contains ( dependency ) ) { edges . add ( dependency ) ; Set < Dependency > outboundEdges = vertices . get ( dependency . getDepender ( ) ) ; if ( outboundEdges == null ) { outboundEdges = new HashSet ( ) ; vertices . put ( dependency . getDepender ( ) , outboundEdges ) ; } outboundEdges . add ( dependency ) ; if ( vertices . get ( dependency . getDependsOn ( ) ) == null ) { vertices . put ( dependency . getDependsOn ( ) , new HashSet ( ) ) ; } } }
add an edge to the dependency graph .
