Range { public abstract Range intersection(Range other); Range(boolean isMinIncluded, boolean isMaxIncluded); boolean contains(byte value); boolean contains(short value); boolean contains(int value); boolean contains(float value); boolean contains(double value); boolean contains(long value); boolean containsN(T value); boolean contains(Range other); boolean intersects(Range other); abstract Range intersection(Range other); abstract Range union(Range other); abstract DataType getDataType(); abstract boolean isPoint(); abstract Number getMax(); abstract Number getMin(); abstract Number getMax(boolean isMaxIncluded); abstract Number getMin(boolean isMinIncluded); boolean isNanIncluded(); boolean isNaN(); boolean isMaxIncluded(); boolean isMinIncluded(); @Override boolean equals(Object obj); int compare(Range other); @Override int hashCode(); static int hash(boolean value, int seed); static int hash(double value, int seed); static int hash(long value, int seed); @Override String toString();  }
@Test public void testIntersectionValidRange() { Range doubleRange = RangeFactory.create(-9999, -9999); Range byteRange = RangeFactory.create(0, 255); Range intersection = byteRange.intersection(doubleRange); assertNull(intersection); }
@Test public void testIntersectionOutsideIntRangeByte() { Range doubleRange = RangeFactory.create(-10e32, -10e32); Range byteRange = RangeFactory.create((byte) 0, (byte) 255); Range intersection = byteRange.intersection(doubleRange); assertNull(intersection); }
@Test public void testIntersectionOutsideIntRangeShort() { Range doubleRange = RangeFactory.create(-10e32, -10e32); Range byteRange = RangeFactory.create((short) 0, (short) 255); Range intersection = byteRange.intersection(doubleRange); assertNull(intersection); }