ExtAtomContainerManipulator extends AtomContainerManipulator { public static int getHydrogenCount(IAtomContainer atomContainer, IAtom atom) { return getExplicitHydrogenCount(atomContainer, atom) + getImplicitHydrogenCount(atom); }  static IAtomContainer makeDeepCopy(IAtomContainer container); static void aromatizeMolecule(IAtomContainer mol); static int getExplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom); static int getImplicitHydrogenCount(IAtom atom); static int getHydrogenCount(IAtomContainer atomContainer, IAtom atom); static IAtomContainer removeHydrogensExceptSingleAndPreserveAtomID(IAtomContainer atomContainer); static IAtomContainer convertExplicitToImplicitHydrogens(IAtomContainer atomContainer); static void percieveAtomTypesAndConfigureAtoms(IAtomContainer container);  }
@Test public void testGetHydrogenCount() throws InvalidSmilesException { String rawMolSmiles = "[H]POOSC(Br)C(Cl)C(F)I"; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer atomContainer = sp.parseSmiles(rawMolSmiles); IAtom atom = null; for (IAtom a : atomContainer.atoms()) { if (a.getSymbol().equalsIgnoreCase("P")) { atom = a; break; } } int expResult = 2; int result = ExtAtomContainerManipulator.getHydrogenCount(atomContainer, atom); assertEquals(expResult, result); }