code: private boolean checkRingLink(IRingSet ringSet, IAtomContainer ac, IAtom atom) {
          List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
          if (ringSet.contains(atom)) {
              return true;
          }
          for (IAtom neighbour : neighbours) {
              if (ringSet.contains(neighbour)) {
                  return true;
              }
          }
          return false;
      }
docs: Check if atom or neighbour atom is part of a ring
  
  @param  ac    Description of the Parameter
  @param  atom  Description of the Parameter
  @return       The hydrogenCount value