code: private boolean isHeteroRingSystem(IAtomContainer ac) {
          if (ac != null) {
              for (int i = 0; i < ac.getAtomCount(); i++) {
                  if (!(ac.getAtom(i).getSymbol()).equals("H") && !(ac.getAtom(i).getSymbol()).equals("C")) {
                      return true;
                  }
              }
          }
          return false;
      }
docs: Returns true if atom is in hetero ring system
  
  @param  ac  AtomContainer
  @return     true/false