RangeImpl implements Range { @Override public Boolean includes(Object param) { if (param == null) { return null; } if (lowEndPoint == null) { if (highEndPoint == null) { return null; } else { return negInfRangeIncludes(param); } } else { if (highEndPoint == null) { return posInfRangeIncludes(param); } else { return finiteRangeIncludes(param); } } } RangeImpl();  RangeImpl(RangeBoundary lowBoundary, Comparable lowEndPoint, Comparable highEndPoint, RangeBoundary highBoundary); @Override RangeBoundary getLowBoundary(); @Override Comparable getLowEndPoint(); @Override Comparable getHighEndPoint(); @Override RangeBoundary getHighBoundary(); @Override Boolean includes(Object param); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void includes() { RangeImpl rangeImpl = new RangeImpl(Range.RangeBoundary.OPEN, 10, 15, Range.RangeBoundary.OPEN); Assert.assertFalse(rangeImpl.includes(-15)); Assert.assertFalse(rangeImpl.includes(5)); Assert.assertFalse(rangeImpl.includes(10)); Assert.assertTrue(rangeImpl.includes(12)); Assert.assertFalse(rangeImpl.includes(15)); Assert.assertFalse(rangeImpl.includes(156)); rangeImpl = new RangeImpl(Range.RangeBoundary.CLOSED, 10, 15, Range.RangeBoundary.OPEN); Assert.assertTrue(rangeImpl.includes(10)); Assert.assertTrue(rangeImpl.includes(12)); Assert.assertFalse(rangeImpl.includes(15)); rangeImpl = new RangeImpl(Range.RangeBoundary.OPEN, 10, 15, Range.RangeBoundary.CLOSED); Assert.assertFalse(rangeImpl.includes(10)); Assert.assertTrue(rangeImpl.includes(12)); Assert.assertTrue(rangeImpl.includes(15)); rangeImpl = new RangeImpl(Range.RangeBoundary.CLOSED, 10, 15, Range.RangeBoundary.CLOSED); Assert.assertTrue(rangeImpl.includes(10)); Assert.assertTrue(rangeImpl.includes(12)); Assert.assertTrue(rangeImpl.includes(15)); }