public static <NodeType extends ZyGraphNode<? extends IViewNode<?>>>
      void hideMultipleEdgesInternal(final NodeType node) {
    if (!node.isVisible() || (node.getRawNode() instanceof IGroupNode<?, ?>)) {
      // If the node is not visible, then none of the edges are visible.
      return;
    }

    final HashSet<Object> targets = new HashSet<Object>();

    for (final IViewEdge<?> edge : ((IViewNode<?>) node.getRawNode()).getOutgoingEdges()) {
      final Object target = edge.getTarget();

      if (targets.contains(target)) {
        edge.setVisible(false);
      } else {
        targets.add(target);
      }
    }

    final HashSet<Object> sources = new HashSet<Object>();

    for (final IViewEdge<?> edge : ((IViewNode<?>) node.getRawNode()).getIncomingEdges()) {
      if (sources.contains(edge.getSource())) {
        edge.setVisible(false);
      } else {
        sources.add(edge.getSource());
      }
    }
  }
Class to form a single edge out of a number of edges.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/zygraph/proximity/MultiEdgeHider.java