code: private boolean isSingleHeteroAtom(IAtom atom, IAtomContainer container) {
  
          List<IAtom> connected = container.getConnectedAtomsList(atom);
  
          for (IAtom atom1 : connected) {
  
              boolean aromatic = container.getBond(atom, atom1).isAromatic();
  
              // ignoring non-aromatic bonds
              if (!aromatic) continue;
  
              // found a hetroatom - we're not a single hetroatom
              if (!"C".equals(atom1.getSymbol())) return false;
  
              // check the second sphere
              for (IAtom atom2 : container.getConnectedAtomsList(atom1)) {
  
                  if (!atom2.equals(atom) && container.getBond(atom1, atom2).isAromatic()
                          && !"C".equals(atom2.getSymbol())) {
                      return false;
                  }
  
              }
  
          }
  
          return true;
  
      }
docs: Determines whether the bonds (up to two spheres away) are only to non
  hetroatoms. Currently used in N.planar3 perception of (e.g. pyrrole).
  
  @param atom an atom to test
  @param container container of the atom
  
  @return whether the atom's only bonds are to heteroatoms
  @see #perceiveNitrogens(IAtomContainer, IAtom, RingSearch, List)