ToleranceRangeRule implements IRule { @Override public Object[] getParameters() { Object[] params = new Object[2]; params[0] = mass; params[1] = tolerance; return params; } ToleranceRangeRule(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override double validate(IMolecularFormula formula);  }
@Test public void testDefault() throws Exception { IRule rule = new ToleranceRangeRule(); Object[] objects = rule.getParameters(); Assert.assertEquals(2, objects.length); double mass = (Double) objects[0]; Assert.assertEquals(0.0, mass, 0.00001); double tolerance = (Double) objects[1]; Assert.assertEquals(0.05, tolerance, 0.00001); }