@Test
public void testSetParameters() throws Exception {

    IRule rule = new ElementRule();
    Object[] params = new Object[1];
    MolecularFormulaRange mfRange = new MolecularFormulaRange();
    mfRange.addIsotope(builder.newInstance(IIsotope.class, "C"), 1, 10);
    mfRange.addIsotope(builder.newInstance(IIsotope.class, "H"), 1, 10);
    params[0] = mfRange;
    rule.setParameters(params);
    Object[] objects = rule.getParameters();
    Assert.assertEquals(1, objects.length);
    MolecularFormulaRange mfRange2 = (MolecularFormulaRange) objects[0];
    Assert.assertEquals(mfRange.getIsotopeCount(), mfRange2.getIsotopeCount());
    Assert.assertEquals(mfRange.getIsotopeCountMin(new Isotope("C")), mfRange2.getIsotopeCountMin(new Isotope("C")));
    Assert.assertEquals(mfRange.getIsotopeCountMax(new Isotope("C")), mfRange2.getIsotopeCountMax(new Isotope("C")));
}