### Question:
MolecularFormulaGenerator implements IFormulaGenerator { @Override public IMolecularFormula getNextFormula() { return formulaGenerator.getNextFormula(); } MolecularFormulaGenerator(final IChemObjectBuilder builder,
                                     final double minMass, final double maxMass,
                                     final MolecularFormulaRange mfRange); @Override IMolecularFormula getNextFormula(); @Override IMolecularFormulaSet getAllFormulas(); @Override double getFinishedPercentage(); @Override void cancel();  }### Answer:
@Test public void testGetNextFormula() throws Exception { IsotopeFactory ifac = Isotopes.getInstance(); IIsotope c = ifac.getMajorIsotope("C"); IIsotope h = ifac.getMajorIsotope("H"); IIsotope n = ifac.getMajorIsotope("N"); IIsotope o = ifac.getMajorIsotope("O"); MolecularFormulaRange mfRange = new MolecularFormulaRange(); mfRange.addIsotope(c, 0, 10); mfRange.addIsotope(h, 0, 10); mfRange.addIsotope(o, 0, 10); mfRange.addIsotope(n, 0, 10); double minMass = 100.0; double maxMass = 100.05; MolecularFormulaGenerator gen = new MolecularFormulaGenerator(builder, minMass, maxMass, mfRange); IMolecularFormula f = gen.getNextFormula(); Assert.assertNotNull(f); }