@Test
public void testGetMinOccurrenceElements_IMolecularFormulaSet() {

    IMolecularFormula mf1 = new MolecularFormula(); /* C4H12NO4 */
    mf1.addIsotope(builder.newInstance(IIsotope.class, "C"), 4);
    mf1.addIsotope(builder.newInstance(IIsotope.class, "H"), 12);
    mf1.addIsotope(builder.newInstance(IIsotope.class, "N"), 1);
    mf1.addIsotope(builder.newInstance(IIsotope.class, "O"), 4);
    IMolecularFormula mf2 = new MolecularFormula(); /* C7H20N4O2 */
    mf2.addIsotope(builder.newInstance(IIsotope.class, "C"), 7);
    mf2.addIsotope(builder.newInstance(IIsotope.class, "H"), 20);
    mf2.addIsotope(builder.newInstance(IIsotope.class, "N"), 4);
    mf2.addIsotope(builder.newInstance(IIsotope.class, "O"), 2);
    IMolecularFormula mf3 = new MolecularFormula(); /* C9H5O7 */
    mf3.addIsotope(builder.newInstance(IIsotope.class, "C"), 9);
    mf3.addIsotope(builder.newInstance(IIsotope.class, "H"), 5);
    mf3.addIsotope(builder.newInstance(IIsotope.class, "O"), 7);
    IMolecularFormulaSet mfSet = new MolecularFormulaSet();
    mfSet.addMolecularFormula(mf1);
    mfSet.addMolecularFormula(mf2);
    mfSet.addMolecularFormula(mf3);
    IMolecularFormula molecularFormula = MolecularFormulaSetManipulator.getMinOccurrenceElements(mfSet);
    /* Result: C4H5NO2 */
    Assert.assertEquals(12, MolecularFormulaManipulator.getAtomCount(molecularFormula));
    Assert.assertEquals(4, molecularFormula.getIsotopeCount());
    Assert.assertEquals(4, molecularFormula.getIsotopeCount(builder.newInstance(IIsotope.class, "C")));
    Assert.assertEquals(5, molecularFormula.getIsotopeCount(builder.newInstance(IIsotope.class, "H")));
    Assert.assertEquals(1, molecularFormula.getIsotopeCount(builder.newInstance(IIsotope.class, "N")));
    Assert.assertEquals(2, molecularFormula.getIsotopeCount(builder.newInstance(IIsotope.class, "O")));
}