code: public static int getExplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
          int hCount = 0;
          for (IAtom iAtom : atomContainer.getConnectedAtomsList(atom)) {
              IAtom connectedAtom = iAtom;
              if (connectedAtom.getSymbol().equals("H")) {
                  hCount++;
              }
          }
          return hCount;
      }
docs: Returns The number of explicit hydrogens for a given IAtom.
  @param atomContainer
  @param atom
  @return The number of explicit hydrogens on the given IAtom.