@Test
public void testFormulaFoundInRange2() 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, 1, 50);
    mfRange.addIsotope(h, 1, 100);
    mfRange.addIsotope(o, 1, 50);
    mfRange.addIsotope(n, 1, 50);
    double minMass = 187;
    double maxMass = 189;
    MolecularFormulaGenerator gen = new MolecularFormulaGenerator(builder,
            minMass, maxMass, mfRange);
    IMolecularFormulaSet mfSet = gen.getAllFormulas();
    Assert.assertEquals(528, mfSet.size());
    boolean found = false;
    for (IMolecularFormula formula : mfSet.molecularFormulas()) {
        String mf = MolecularFormulaManipulator.getString(formula);
        if (mf.equals("C11H10NO2")) {
            found = true;
            break;
        }
    }
    Assert.assertTrue("The molecular formula C11H10NO2 should be found",
            found);
}