### Question:
DiscretizationUtil { static public boolean contains(Interval interval, double value){ Double left = interval.getLeftMargin(); Double right = interval.getRightMargin(); Interval.Closure closure = interval.getClosure(); switch(closure){ case OPEN_CLOSED: return greaterThan(value, left) && lessOrEqual(value, right); case OPEN_OPEN: return greaterThan(value, left) && lessThan(value, right); case CLOSED_OPEN: return greaterOrEqual(value, left) && lessThan(value, right); case CLOSED_CLOSED: return greaterOrEqual(value, left) && lessOrEqual(value, right); default: throw new UnsupportedFeatureException(interval, closure); } } private  DiscretizationUtil(); static FieldValue discretize(Discretize discretize, FieldValue value); static String discretize(Discretize discretize, double value); static boolean contains(Interval interval, double value); static FieldValue mapValue(MapValues mapValues, Map<String, FieldValue> values);  }### Answer:
@Test public void contains(){ Double min = Double.valueOf(Integer.MIN_VALUE); Double max = Double.valueOf(Integer.MAX_VALUE); Interval negative = createInterval(Interval.Closure.OPEN_OPEN, min, 0.0); assertTrue(DiscretizationUtil.contains(negative, -1.0)); assertFalse(DiscretizationUtil.contains(negative, 0.0)); Interval negativeNull = createInterval(Interval.Closure.OPEN_OPEN, null, 0.0); assertTrue(DiscretizationUtil.contains(negativeNull, -1.0)); assertFalse(DiscretizationUtil.contains(negativeNull, 0.0)); Interval positive = createInterval(Interval.Closure.OPEN_OPEN, 0.0, max); assertFalse(DiscretizationUtil.contains(positive, 0.0)); assertTrue(DiscretizationUtil.contains(positive, 1.0)); Interval positiveNull = createInterval(Interval.Closure.OPEN_OPEN, 0.0, null); assertFalse(DiscretizationUtil.contains(positiveNull, 0.0)); assertTrue(DiscretizationUtil.contains(positiveNull, 1.0)); Interval negativeAndZero = createInterval(Interval.Closure.OPEN_CLOSED, min, 0.0); assertTrue(DiscretizationUtil.contains(negativeAndZero, -1.0)); assertTrue(DiscretizationUtil.contains(negativeAndZero, 0.0)); Interval zeroAndPositive = createInterval(Interval.Closure.CLOSED_OPEN, 0.0, max); assertTrue(DiscretizationUtil.contains(zeroAndPositive, 0.0)); assertTrue(DiscretizationUtil.contains(zeroAndPositive, 1.0)); }