code: public void addImplicitHydrogens(IAtomContainer container, IAtom atom) throws CDKException {
          if (atom.getAtomTypeName() == null) throw new CDKException("IAtom is not typed! " + atom.getSymbol());
  
          if ("X".equals(atom.getAtomTypeName())) {
              if (atom.getImplicitHydrogenCount() == null) atom.setImplicitHydrogenCount(0);
              return;
          }
  
          IAtomType type = atomTypeList.getAtomType(atom.getAtomTypeName());
          if (type == null)
              throw new CDKException("Atom type is not a recognized CDK atom type: " + atom.getAtomTypeName());
  
          if (type.getFormalNeighbourCount() == CDKConstants.UNSET)
              throw new CDKException(
                      "Atom type is too general; cannot decide the number of implicit hydrogen to add for: "
                              + atom.getAtomTypeName());
  
          // very simply counting: each missing explicit neighbor is a missing hydrogen
          atom.setImplicitHydrogenCount(type.getFormalNeighbourCount() - container.getConnectedBondsCount(atom));
      }
docs: Sets the implicit hydrogen count for the indicated IAtom in the given IAtomContainer.
  If the atom type is "X", then the atom is assigned zero implicit hydrogens.
  
  @param  container  The molecule to which H's will be added
  @param  atom         IAtom to set the implicit hydrogen count for
  @throws CDKException Throws if insufficient information is present