code: @Override
      public double validate(IMolecularFormula formula) throws CDKException {
          logger.info("Start validation of ", formula);
  
          double totalExactMass = MolecularFormulaManipulator.getTotalExactMass(formula);
  
          if (Math.abs(totalExactMass - mass) > tolerance)
              return 0.0;
          else
              return 1.0;
      }
docs: Validate the Tolerance Range of this IMolecularFormula.
  
  @param formula   Parameter is the IMolecularFormula
  @return          A double value meaning 1.0 True, 0.0 False