@Test
public void testCompoundWith7Elements() 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");
    IIsotope s = ifac.getMajorIsotope("S");
    IIsotope p = ifac.getMajorIsotope("P");
    IIsotope cl = ifac.getMajorIsotope("Cl");
    MolecularFormulaRange mfRange = new MolecularFormulaRange();
    mfRange.addIsotope(c, 7, 9);
    mfRange.addIsotope(h, 8, 10);
    mfRange.addIsotope(o, 1, 3);
    mfRange.addIsotope(n, 0, 2);
    mfRange.addIsotope(s, 0, 2);
    mfRange.addIsotope(p, 0, 2);
    mfRange.addIsotope(cl, 2, 4);
    double minMass = 318.915719 - 0.0001;
    double maxMass = 318.915719 + 0.0001;
    MolecularFormulaGenerator gen = new MolecularFormulaGenerator(builder,
            minMass, maxMass, mfRange);
    IMolecularFormulaSet mfSet = gen.getAllFormulas();
    Assert.assertNotNull(mfSet);
    Assert.assertEquals(1, mfSet.size());
    Assert.assertEquals("C8H9Cl3NO2PS", MolecularFormulaManipulator
            .getString(mfSet.getMolecularFormula(0)));
}