code: private void traverseRing(int[] ringSystem, int v, int rnum) {
          ringSystem[v] = rnum;
          for (int w : adjList[v]) {
              if (ringSystem[w] == 0 && bondMap.get(v, w).isInRing())
                  traverseRing(ringSystem, w, rnum);
          }
      }
docs: Simple method for marking ring systems with a flood-fill.
  
  @param ringSystem ring system vector
  @param v          start atom
  @param rnum       the number to mark atoms of this ring