private static SuperDiffEdge buildDiffEdge(
      final SuperGraph diffGraph,
      final SuperViewEdge<? extends SuperViewNode> rawSuperJump,
      final SingleDiffEdge primaryDiffEdge,
      final SingleDiffEdge secondaryDiffEdge) {
    final ZyLabelContent superEdgeContent = new ZyLabelContent(null);
    final ZyEdgeRealizer<SuperDiffEdge> superEdgeRealizer =
        new ZyEdgeRealizer<>(superEdgeContent, null);

    SuperDiffNode srcSuperDiffNode = null;
    SuperDiffNode tarSuperDiffNode = null;

    if (primaryDiffEdge != null) {
      srcSuperDiffNode = primaryDiffEdge.getSource().getSuperDiffNode();
      tarSuperDiffNode = primaryDiffEdge.getTarget().getSuperDiffNode();
    } else if (secondaryDiffEdge != null) {
      srcSuperDiffNode = secondaryDiffEdge.getSource().getSuperDiffNode();
      tarSuperDiffNode = secondaryDiffEdge.getTarget().getSuperDiffNode();
    }

    final Node srcSuperYNode = srcSuperDiffNode.getNode();
    final Node tarSuperYNode = tarSuperDiffNode.getNode();

    final boolean srcVisible = srcSuperDiffNode.getRawNode().isVisible();
    final boolean tarVisible = tarSuperDiffNode.getRawNode().isVisible();
    srcSuperDiffNode.getRawNode().setVisible(true);
    tarSuperDiffNode.getRawNode().setVisible(true);

    Edge ySuperEdge = diffGraph.getGraph().createEdge(srcSuperYNode, tarSuperYNode);
    final SuperDiffEdge superDiffEdge =
        new SuperDiffEdge(
            srcSuperDiffNode,
            tarSuperDiffNode,
            ySuperEdge,
            superEdgeRealizer,
            rawSuperJump,
            primaryDiffEdge,
            secondaryDiffEdge);
    SuperDiffNode.link(srcSuperDiffNode, tarSuperDiffNode);
    superEdgeRealizer.setUserData(new ZyEdgeData<>(superDiffEdge));

    srcSuperDiffNode.getRawNode().setVisible(srcVisible);
    tarSuperDiffNode.getRawNode().setVisible(tarVisible);

    diffGraph.addEdgeToMappings(superDiffEdge);

    return superDiffEdge;
  }
Utility class to remove basic block matches from BinDiff graphs.
java/ui/src/main/java/com/google/security/zynamics/bindiff/graph/helpers/BasicBlockMatchRemover.java