code: public static IMolecularFormula getMolecularFormula(IAtomContainer atomContainer) {
  
          IMolecularFormula formula = atomContainer.getBuilder().newInstance(IMolecularFormula.class);
  
          return getMolecularFormula(atomContainer, formula);
      }
docs: Method that actually does the work of convert the atomContainer
  to IMolecularFormula.
  <p> The hydrogens must be implicit.
  
  @param 	atomContainer     IAtomContainer object
  @return	a molecular formula object
  @see		#getMolecularFormula(IAtomContainer,IMolecularFormula)