code: @Override
      public IRingSet getConnectedRings(IRing ring) {
          IRingSet connectedRings = ring.getBuilder().newInstance(IRingSet.class);
          IRing tempRing;
          IAtom atom;
          for (int i = 0; i < ring.getAtomCount(); i++) {
              atom = ring.getAtom(i);
              for (int j = 0; j < getAtomContainerCount(); j++) {
                  tempRing = (IRing) getAtomContainer(j);
                  if (tempRing != ring && !connectedRings.contains(tempRing) && tempRing.contains(atom)) {
                      connectedRings.addAtomContainer(tempRing);
                  }
              }
          }
          return connectedRings;
      }
docs: Returns all the rings in the RingSet that share
  one or more atoms with a given ring.
  
  @param   ring  A ring with which all return rings must share one or more atoms
  @return  All the rings that share one or more atoms with a given ring.