code: public static IAtom getAtomById(IAtomContainer ac, String id) throws CDKException {
          for (int i = 0; i < ac.getAtomCount(); i++) {
              if (ac.getAtom(i).getID() != null && ac.getAtom(i).getID().equals(id)) return ac.getAtom(i);
          }
          throw new CDKException("no suc atom");
      }
docs: Returns an atom in an atomcontainer identified by id
  
  @param ac The AtomContainer to search in
  @param id The id to search for
  @return An atom having id id
  @throws CDKException There is no such atom