class MolecularFormulaChecker {

    public IMolecularFormula isValid(IMolecularFormula formula) {
        logger.info("Generating the validity of the molecular formula");

        if (formula.getIsotopeCount() == 0) {
            logger.error("Proposed molecular formula has not elements");
            return formula;
        }

        Iterator<IRule> iterRules = rules.iterator();
        try {
            while (iterRules.hasNext()) {
                IRule rule = iterRules.next();
                double result = rule.validate(formula);
                formula.setProperty(rule.getClass(), result);

            }
        } catch (CDKException e) {
            e.printStackTrace();
        }

        return formula;
    }

    public  MolecularFormulaChecker(List<IRule> rules);

}