private static void insertNewDiffNodes(
      final GraphsContainer graphs,
      final RawCombinedFlowGraph<RawCombinedBasicBlock, RawCombinedJump<RawCombinedBasicBlock>>
          combinedRawFlowgraph,
      final SuperViewNode newRawSuperBasicblock)
      throws GraphLayoutException {
    final RawCombinedBasicBlock newRawCombinedBasicblock =
        (RawCombinedBasicBlock) newRawSuperBasicblock.getCombinedNode();
    final ESide side =
        newRawCombinedBasicblock.getRawNode(ESide.PRIMARY) != null
            ? ESide.PRIMARY
            : ESide.SECONDARY;

    final CombinedGraph combinedGraph = graphs.getCombinedGraph();
    final SingleGraph singleGraph =
        side == ESide.PRIMARY ? graphs.getPrimaryGraph() : graphs.getSecondaryGraph();
    final SuperGraph superGraph = graphs.getSuperGraph();

    // create new diff nodes
    final MatchData matches = graphs.getDiff().getMatches();
    final FunctionMatchData functionMatch =
        matches.getFunctionMatch(
            side == ESide.PRIMARY
                ? newRawCombinedBasicblock.getPrimaryFunctionAddress()
                : newRawCombinedBasicblock.getSecondaryFunctionAddress(),
            side);

    final SingleDiffNode newSingleDiffNode =
        buildDiffNode(singleGraph, functionMatch, combinedRawFlowgraph, newRawCombinedBasicblock);
    final SuperDiffNode newSuperDiffNode =
        buildDiffNode(
            superGraph,
            side == ESide.PRIMARY ? newSingleDiffNode : null,
            side == ESide.SECONDARY ? newSingleDiffNode : null,
            newRawSuperBasicblock);
    final CombinedDiffNode newCombinedDiffNode =
        buildDiffNode(
            combinedGraph,
            side == ESide.PRIMARY ? newSingleDiffNode : null,
            side == ESide.SECONDARY ? newSingleDiffNode : null,
            newSuperDiffNode,
            newRawCombinedBasicblock);

    // each node gets it's representatives of the parallel views
    // update node mappings
    // set node content editors
    newSuperDiffNode.setCombinedDiffNode(newCombinedDiffNode);
    newSingleDiffNode.setCombinedDiffNode(newCombinedDiffNode);
    singleGraph.addNodeToMappings(newSingleDiffNode);
    final BasicBlockContentEditor nodeEditor =
        new BasicBlockContentEditor(functionMatch, graphs, side);
    newSingleDiffNode.getRealizer().getNodeContent().setLineEditor(nodeEditor);

    combinedGraph.addNodeToMappings(newCombinedDiffNode);
    superGraph.addNodeToMappings(newSuperDiffNode);

    // colorize new basicblock node's background and border color
    ViewFlowGraphBuilder.colorizeBasicBlocks(functionMatch, newRawCombinedBasicblock);
    ViewFlowGraphBuilder.colorizeCombinedNodeLineBorders(
        combinedGraph.getNodes(),
        combinedGraph.getPrimaryGraph().getFunctionAddress(),
        combinedGraph.getSecondaryGraph().getFunctionAddress());
    ViewFlowGraphBuilder.colorizeSingleNodeLineBorders(
        singleGraph.getNodes(), singleGraph.getFunctionAddress());

    // refresh super node's width and height
    superGraph.refreshSuperNodeSize(
        graphs.getPrimaryGraph(), graphs.getSecondaryGraph(), newSuperDiffNode);

    // create new diff edges and add to graphs
    insertNewDiffEdges(graphs, newSuperDiffNode);
  }
Utility class to remove basic block matches from BinDiff graphs.
java/ui/src/main/java/com/google/security/zynamics/bindiff/graph/helpers/BasicBlockMatchRemover.java