@Test
public void testSelectingMF() {

    IsotopePatternSimilarity is = new IsotopePatternSimilarity();
    IsotopePattern spExp = new IsotopePattern();
    spExp.setCharge(1);
    spExp.setMonoIsotope(new IsotopeContainer(156.07770, 1));
    spExp.addIsotope(new IsotopeContainer(157.07503, 0.0101));
    spExp.addIsotope(new IsotopeContainer(157.08059, 0.074));
    spExp.addIsotope(new IsotopeContainer(158.08135, 0.0024));
    double score = 0;
    String mfString = "";
    String[] listMF = {"C4H8N6O", "C2H12N4O4", "C3H12N2O5", "C6H10N3O2", "CH10N5O4", "C4H14NO5"};
    for (int i = 0; i < listMF.length; i++) {
        IMolecularFormula formula = MolecularFormulaManipulator.getMajorIsotopeMolecularFormula(listMF[i], builder);
        IsotopePatternGenerator isotopeGe = new IsotopePatternGenerator(0.01);
        IsotopePattern patternIsoPredicted = isotopeGe.getIsotopes(formula);
        IsotopePattern patternIsoNormalize = IsotopePatternManipulator.normalize(patternIsoPredicted);
        double tempScore = is.compare(spExp, patternIsoNormalize);
        if (score < tempScore) {
            mfString = MolecularFormulaManipulator.getString(formula);
            score = tempScore;
        }
    }
    Assert.assertEquals("C6H10N3O2", mfString);
}