code: private int getRelatedIndex(List<INode> source, List<INode> target, char relation) {
          int srcIndex = sourceIndex.get(source.get(0).getLevel() - 1);
          int tgtIndex = targetIndex.get(target.get(0).getLevel() - 1);
  
          int returnIndex = -1;
  
          INode sourceNode = source.get(srcIndex);
  
          //find the first one who is related in the same level
          for (int i = tgtIndex + 1; i < target.size(); i++) {
              INode targetNode = target.get(i);
              if (isRelated(sourceNode, targetNode, relation)) {
                  setStrongestMapping(sourceNode, targetNode);
                  return i;
              }
          }
  
          //there was no correspondence between siblings in source and target lists
          //try to clean the mapping elements
          computeStrongestMappingForSource(source.get(srcIndex));
  
          return returnIndex;
      }
docs: Looks for the related index for the source list at the position sourceIndex
  in the target list beginning at the targetIndex position for the defined relation.
  
  @param source   source list of siblings.
  @param target   target list of siblings.
  @param relation relation
  @return the index of the related element in target, or -1 if there is no relate element.