code: public double getMaxNoOfBonds(IAtom atom) throws CDKException {
          double noValenceElectrons = atom.getValency() == CDKConstants.UNSET ? -1 : atom.getValency();
          if (noValenceElectrons == -1) {
              throw new CDKException("Atom property not set: Valency");
          }
          // This will probably only work for group 13-18, and not for helium...
          return 8 - noValenceElectrons;
      }
docs: This method calculates the number of bonds that an <code>IAtom</code>
  can have.
  
  @param atom The <code>IAtom</code> to be investigated
  @return The max number of bonds the <code>IAtom</code> can have
  @throws CDKException when the atom's valency is not set