code: public int getGroup(Node n, List<Collection<Node>> grps) {
          int i = 0;
          for (Collection<Node> pGrp : grps) {
              if (pGrp.contains(n)) {
                  return i;
              }
              i++;
          }
          return -1;
      }
docs: Get the group the node belong to.
  
  @param n the node
  @return the group identifier, {@code -1} if the node does not belong to a group