RDBERule implements IRule { @Override public void setParameters(Object[] params) throws CDKException { if (params.length != 2) throw new CDKException("RDBERule expects two parameters"); if (!(params[0] instanceof Double)) throw new CDKException("The 1 parameter must be of type Double"); if (!(params[1] instanceof Double)) throw new CDKException("The 2 parameter must be of type Double"); min = (Double) params[0]; max = (Double) params[1]; } RDBERule(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override double validate(IMolecularFormula formula); boolean validate(IMolecularFormula formula, double value); List<Double> getRDBEValue(IMolecularFormula formula);  }
@Test public void testSetParameters() throws ClassNotFoundException, CDKException, Exception { IRule rule = new RDBERule(); Object[] params = new Object[2]; params[0] = 0.0; params[1] = 10.0; rule.setParameters(params); Object[] objects = rule.getParameters(); Assert.assertEquals(2, objects.length); double min = (Double) objects[0]; double max = (Double) objects[1]; Assert.assertEquals(0.0, min, 0.00001); Assert.assertEquals(10.0, max, 0.00001); }