private static void insertNewDiffEdges(
      final GraphsContainer graphs, final SuperDiffNode newSuperDiffNode)
      throws GraphLayoutException {
    final SuperGraph superGraph = graphs.getSuperGraph();
    final CombinedGraph combinedGraph = graphs.getCombinedGraph();
    final SingleGraph priGraph = graphs.getPrimaryGraph();
    final SingleGraph secGraph = graphs.getSecondaryGraph();

    final SuperViewNode superViewNode = newSuperDiffNode.getRawNode();
    final Set<SuperViewEdge<? extends SuperViewNode>> newRawSuperJumps = new HashSet<>();
    newRawSuperJumps.addAll(superViewNode.getIncomingEdges());
    newRawSuperJumps.addAll(superViewNode.getOutgoingEdges());

    for (final SuperViewEdge<? extends SuperViewNode> newRawSuperJump : newRawSuperJumps) {
      // build jumps
      final SingleDiffEdge primaryDiffEdge = buildDiffEdge(priGraph, newRawSuperJump);
      final SingleDiffEdge secondaryDiffEdge = buildDiffEdge(secGraph, newRawSuperJump);
      final SuperDiffEdge superDiffEdge =
          buildDiffEdge(superGraph, newRawSuperJump, primaryDiffEdge, secondaryDiffEdge);
      final CombinedDiffEdge combinedDiffEdge =
          buildDiffEdge(combinedGraph, newRawSuperJump, superDiffEdge);

      // each edge gets it's representatives of the parallel views
      ZyEdgeRealizer<SingleDiffEdge> priEdgeRealizer = null;
      ZyEdgeRealizer<SingleDiffEdge> secEdgeRealizer = null;

      superDiffEdge.setCombinedDiffEdge(combinedDiffEdge);
      if (primaryDiffEdge != null) {
        primaryDiffEdge.setCombinedDiffEdge(combinedDiffEdge);
        priEdgeRealizer = primaryDiffEdge.getRealizer();
      }
      if (secondaryDiffEdge != null) {
        secondaryDiffEdge.setCombinedDiffEdge(combinedDiffEdge);
        secEdgeRealizer = secondaryDiffEdge.getRealizer();
      }

      // colorize and stylize jumps
      @SuppressWarnings("unchecked")
      final RawCombinedJump<RawCombinedBasicBlock> rawCombinedJump =
          (RawCombinedJump<RawCombinedBasicBlock>) newRawSuperJump.getCombinedEdge();
      ViewFlowGraphBuilder.colorizeJumps(rawCombinedJump, priEdgeRealizer, secEdgeRealizer);
      ViewFlowGraphBuilder.stylizeJumps(
          rawCombinedJump, combinedDiffEdge.getRealizer(), priEdgeRealizer, secEdgeRealizer);
    }
  }
Utility class to remove basic block matches from BinDiff graphs.
java/ui/src/main/java/com/google/security/zynamics/bindiff/graph/helpers/BasicBlockMatchRemover.java