code: private static void replaceOrthologousEdges(Kam kam,
              Map<KamNode, KamNode> ortho) {
          final Collection<KamEdge> edges = kam.getEdges();
          for (final KamEdge edge : edges) {
              if (ORTHOLOGOUS.equals(edge.getRelationshipType())) {
                  // remove all orthologous edges
                  kam.removeEdge(edge);
              } else {
                  // redirect ortholog's relationships to species replacement
                  final KamNode sn = edge.getSourceNode();
                  final KamNode tn = edge.getTargetNode();
  
                  // when edge's source node is the orthologous node
                  // find the corresponding species
                  KamNode species = ortho.get(sn);
                  if (species != null) {
                      // replace the edge's source as the species node
                      KamNode speciesNode = kam.findNode(species.getId());
                      kam.removeEdge(edge);
                      kam.createEdge(edge.getId(), speciesNode,
                              edge.getRelationshipType(), tn);
                      continue;
                  }
  
                  // when edge's target node is the orthologous node
                  // find the corresponding species
                  species = ortho.get(tn);
                  if (species != null) {
                      // replace the edge's target as the species node
                      KamNode speciesNode = kam.findNode(species.getId());
                      kam.removeEdge(edge);
                      kam.createEdge(edge.getId(), sn,
                              edge.getRelationshipType(), speciesNode);
                      continue;
                  }
              }
          }
      }
docs: Replace orthologous relationships by collapsing to the species
  {@link KamNode node}.  In particular:
  <ul>
  <li>Remove {@link RelationshipType#ORTHOLOGOUS} edges.</li>
  <li>Redirect {@link KamNode ortholog node}'s edges to the
  {@link KamNode species replacement node}.
  </ul>
  
  @param kam {@link Kam}
  @param ortho {@link Map} of K: {@link KamNode ortho node} and
  V: {@link KamNode species target node}