private static void insertNewRawNodes(
      final RawCombinedFlowGraph<RawCombinedBasicBlock, RawCombinedJump<RawCombinedBasicBlock>>
          combinedRawFlowgraph,
      final RawFlowGraph rawFlowgraph,
      final Set<SuperViewEdge<? extends SuperViewNode>> oldRawSuperJumps,
      final SuperViewNode oldRawSuperBasicBlock,
      final RawBasicBlock newRawBasicBlock,
      final RawCombinedBasicBlock newRawCombinedBasicBlock,
      final SuperViewNode newRawSuperBasicBlock) {
    // Add new raw basic blocks to graphs
    combinedRawFlowgraph.addNode(newRawCombinedBasicBlock);
    rawFlowgraph.addNode(newRawBasicBlock);

    // iterate over all the old edges and create corresponding new ones
    // this edges are already removed out of the graphs
    final ESide side = rawFlowgraph.getSide();
    for (final SuperViewEdge<? extends SuperViewNode> oldRawSuperJump : oldRawSuperJumps) {
      if (oldRawSuperJump.getSingleEdge(side) == null) {
        continue;
      }

      SuperViewNode superSource = oldRawSuperJump.getSource();
      RawCombinedBasicBlock combinedSource = (RawCombinedBasicBlock) superSource.getCombinedNode();
      RawBasicBlock source = combinedSource.getRawNode(side);

      SuperViewNode superTarget = oldRawSuperJump.getTarget();
      RawCombinedBasicBlock combinedTarget = (RawCombinedBasicBlock) superTarget.getCombinedNode();
      RawBasicBlock target = combinedTarget.getRawNode(side);

      // Get target basic blocks
      if (superTarget == oldRawSuperBasicBlock) {
        superTarget = newRawSuperBasicBlock;
        combinedTarget = newRawCombinedBasicBlock;
        target = newRawBasicBlock;
      }

      // Get source basic blocks - no else in case of recursive basic blocks
      if (superSource == oldRawSuperBasicBlock) {
        superSource = newRawSuperBasicBlock;
        combinedSource = newRawCombinedBasicBlock;
        source = newRawBasicBlock;
      }

      // Create and add raw jump
      final EJumpType type = ((RawJump) oldRawSuperJump.getSingleEdge(side)).getJumpType();
      final RawJump rawJump = new RawJump(source, target, type);
      rawFlowgraph.addEdge(rawJump);

      // Create and add combined raw jump
      final RawCombinedJump<RawCombinedBasicBlock> newRawCombinedJump =
          new RawCombinedJump<>(
              combinedSource,
              combinedTarget,
              side == ESide.PRIMARY ? rawJump : null,
              side == ESide.SECONDARY ? rawJump : null);
      combinedRawFlowgraph.addEdge(newRawCombinedJump);

      // Create and link super raw jump (see super view edge ctor)
      new SuperViewEdge<>(newRawCombinedJump, superSource, superTarget);
    }
  }
Utility class to remove basic block matches from BinDiff graphs.
java/ui/src/main/java/com/google/security/zynamics/bindiff/graph/helpers/BasicBlockMatchRemover.java