code: @Override
      public void collapseNode(final KamNode from, KamNode to) {
          // redirect FROM's outgoing edges to TO
          Set<KamEdge> edges = nodeSourceMap.get(from);
          Set<KamEdge> dest = nodeSourceMap.get(to);
          for (final KamEdge e : edges) {
              ((KamEdgeImpl) e).setSourceNode(to);
  
              edges.remove(e);
              dest.add(e);
          }
  
          // redirect FROM's incoming edges to TO
          edges = nodeTargetMap.get(from);
          dest = nodeTargetMap.get(to);
          for (final KamEdge e : edges) {
              ((KamEdgeImpl) e).setTargetNode(to);
  
              edges.remove(e);
              dest.add(e);
          }
  
          // remove the FROM node
          removeNode(from);
      }
docs: {@inheritDoc}