Range { public void expand(double value) { if (value < min || Double.isNaN(min)) min = value; if (value > max || Double.isNaN(max)) max = value; }  void expand(double value); boolean isEmpty(); double range(); @NonNull @Override String toString(); public double min; public double max; }
@Test public void expand() { Range range = new Range(); range.expand(2.718); range.expand(3.14); assertEquals(2.718, range.min, 0.0001); assertEquals(3.14, range.max, 0.0001); }