code: private static int charge(IAtom atom) {
          Integer charge = atom.getFormalCharge();
          if (charge != null) return charge;
          return 0;
      }
docs: Access formal charge of an atom defaulting to 0 if undefined.
  
  @param atom an atom
  @return the formal charge