private void replaceVertex(JavaClass newClass) {
    List<JavaClass> incomingEdges = getParents(newClass);

    graph.removeVertex(newClass);
    graph.addVertex(newClass);
    for (JavaClass each : incomingEdges) {
      graph.addEdge(each, newClass);
    }
  }
 private void addToGraph(JavaClass newClass) {
   if (!graph.addVertex(newClass)) {
     replaceVertex(newClass);
   }
 }