@Test public void testOpenClosed() throws Exception { Range<Integer> openClosed = Range.openClosed(0, 2); assertFalse(openClosed.contains(-1)); assertFalse(openClosed.contains(0)); assertTrue(openClosed.contains(1)); assertTrue(openClosed.contains(2)); assertFalse(openClosed.contains(3)); }
public static <T extends Comparable<T>> Range<T> openClosed(T lower, T upper) { return new Range<>(lower, false, upper, true); }
Range { public static <T extends Comparable<T>> Range<T> openClosed(T lower, T upper) { return new Range<>(lower, false, upper, true); } }
Range { public static <T extends Comparable<T>> Range<T> openClosed(T lower, T upper) { return new Range<>(lower, false, upper, true); } private  Range(T lower, boolean includesLower, T upper, boolean includesUpper); }
Range { public static <T extends Comparable<T>> Range<T> openClosed(T lower, T upper) { return new Range<>(lower, false, upper, true); } private  Range(T lower, boolean includesLower, T upper, boolean includesUpper); static Range<T> open(T lower, T upper); static Range<T> closed(T lower, T upper); static Range<T> openClosed(T lower, T upper); static Range<T> closedOpen(T lower, T upper); boolean contains(T value); T getLowerBound(); T getUpperBound(); @Override String toString(); }
Range { public static <T extends Comparable<T>> Range<T> openClosed(T lower, T upper) { return new Range<>(lower, false, upper, true); } private  Range(T lower, boolean includesLower, T upper, boolean includesUpper); static Range<T> open(T lower, T upper); static Range<T> closed(T lower, T upper); static Range<T> openClosed(T lower, T upper); static Range<T> closedOpen(T lower, T upper); boolean contains(T value); T getLowerBound(); T getUpperBound(); @Override String toString();  }