code: private static int[][] findAromaticRings(int[][] cycles, int[] contribution, int[] dbs) {
  
          // loop control variables, the while loop continual checks all cycles
          // until no changes are found
          boolean found;
          boolean[] checked = new boolean[cycles.length];
  
          // stores the aromatic atoms as a bit set and the aromatic bonds as
          // a hash set. the aromatic bonds are the result of this method but the
          // aromatic atoms are needed for checking each ring
          final boolean[] aromaticAtoms = new boolean[contribution.length];
  
          final List<int[]> ringsOfSize6 = new ArrayList<int[]>();
          final List<int[]> ringsOfSize5 = new ArrayList<int[]>();
  
          do {
              found = false;
              for (int i = 0; i < cycles.length; i++) {
  
                  // note paths are closed walks and repeat first/last vertex so
                  // the true length is one less
                  int[] cycle = cycles[i];
                  int len = cycle.length - 1;
  
                  if (checked[i]) continue;
  
                  if (isAromaticRing(cycle, contribution, dbs, aromaticAtoms)) {
                      checked[i] = true;
                      found |= true;
                      for (int j = 0; j < len; j++) {
                          aromaticAtoms[cycle[j]] = true;
                      }
                      if (len == 6)
                          ringsOfSize6.add(cycle);
                      else if (len == 5) ringsOfSize5.add(cycle);
  
                  }
              }
          } while (found);
  
          List<int[]> rings = new ArrayList<int[]>();
          rings.addAll(ringsOfSize6);
          rings.addAll(ringsOfSize5);
  
          return rings.toArray(new int[rings.size()][]);
      }
docs: From a provided set of cycles find the 5/6 member cycles that fit the MMFF aromaticity
  definition - {@link #isAromaticRing(int[], int[], int[], boolean[])}. The cycles of size 6
  are listed first.
  
  @param cycles       initial set of cycles from
  @param contribution vector of p electron contributions from each vertex
  @param dbs          vector of double-bond pairs, index stored double-bonded index
  @return the cycles that are aromatic