code: private static double correctMass(double mass, Integer charge) {
          if (charge == null)
              return mass;
          double massE = 0.00054857990927;
          if (charge > 0)
              mass -= massE * charge;
          else if (charge < 0) mass += massE * Math.abs(charge);
          return mass;
      }
docs: Correct the mass according the charge of the IMmoleculeFormula.
  Negative charge will add the mass of one electron to the mass.
  
  @param mass      The mass to correct
  @param charge    The charge
  @return          The mass with the correction