code: @Override
      public IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom) throws CDKException {
          if (factory == null) {
              try {
                  factory = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/structgen_atomtypes.xml",
                          atom.getBuilder());
              } catch (Exception ex1) {
                  logger.error(ex1.getMessage());
                  logger.debug(ex1);
                  throw new CDKException("Could not instantiate the AtomType list!", ex1);
              }
          }
  
          double bondOrderSum = atomContainer.getBondOrderSum(atom);
          IBond.Order maxBondOrder = atomContainer.getMaximumBondOrder(atom);
          int charge = atom.getFormalCharge();
          int hcount = atom.getImplicitHydrogenCount() == null ? 0 : atom.getImplicitHydrogenCount();
  
          IAtomType[] types = factory.getAtomTypes(atom.getSymbol());
          for (IAtomType type : types) {
              logger.debug("   ... matching atom ", atom, " vs ", type);
              if (bondOrderSum - charge + hcount == type.getBondOrderSum()
                      && !BondManipulator.isHigherOrder(maxBondOrder, type.getMaxBondOrder())) {
                  return type;
              }
          }
          logger.debug("    No Match");
  
          return null;
      }
docs: Finds the AtomType matching the Atom's element symbol, formal charge and
  hybridization state.
  
  @param  atomContainer  AtomContainer
  @param  atom            the target atom
  @exception CDKException Exception thrown if something goes wrong
  @return                 the matching AtomType