RangeValue implements Value { @Override public double getValue() { return getRandomNumber(this.min, this.max); } RangeValue();  RangeValue(double max);  RangeValue(double min, double max); void setMin(double min); void setMax(double max); @Override double getValue(); @Override double getMin(); @Override double getMax(); @Override String toString();  }
@Test public void testGetValue() { System.out.println("getValue"); double minVal = 3.0; double maxVal = 4.0; rangeVal.setMin(minVal); rangeVal.setMax(maxVal); for (int i = 0; i < 10; i++) { double retrievedVal = rangeVal.getValue(); double min = rangeVal.getMin(); double max = rangeVal.getMax(); System.out.println("Retieved val: " + retrievedVal); assertEquals(minVal, min, 0.000d); assertEquals(maxVal, max, 0.000d); assertTrue("Value must be above or equal to " + minVal, retrievedVal >= minVal); assertTrue("Value must be below or equal to " + maxVal, retrievedVal <= maxVal); } rangeVal = new RangeValue(maxVal); assertTrue(rangeVal.getMin() == 0); }