code: private static IAtom findOtherSinglyBonded(IAtomContainer container, IAtom atom, IAtom exclude) {
          for (final IBond bond : container.getConnectedBondsList(atom)) {
              if (!IBond.Order.SINGLE.equals(bond.getOrder()) || bond.contains(exclude)) continue;
              return bond.getOther(atom);
          }
          return atom;
      }
docs: Finds a neighbor attached to 'atom' that is singley bonded and isn't
  'exclude'. If no such atom exists, the 'atom' is returned.
  
  @param container a molecule container
  @param atom      the atom to find the neighbor or
  @param exclude   don't find this atom
  @return the other atom (or 'atom')