@Test public void testIsEmpty(){ assertTrue (new Range<Integer>(Integer.class, 0, -1 ).isEmpty()); assertFalse(new Range<Integer>(Integer.class, 0, 0 ).isEmpty()); assertFalse(new Range<Integer>(Integer.class, 0, 1 ).isEmpty()); assertFalse(new Range<Integer>(Integer.class, null, 1).isEmpty()); assertFalse(new Range<Integer>(Integer.class, 0, null).isEmpty()); assertTrue ("(0,0)", new Range<Integer>(Integer.class, 0, false, 0, false).isEmpty()); assertTrue ("[0,0)", new Range<Integer>(Integer.class, 0, true, 0, false).isEmpty()); assertTrue ("(0,0]", new Range<Integer>(Integer.class, 0, false, 0, true ).isEmpty()); assertFalse("[0,0]", new Range<Integer>(Integer.class, 0, true, 0, true ).isEmpty()); assertTrue (EMPTY .isEmpty()); assertFalse(UNIT .isEmpty()); assertFalse(ZERO .isEmpty()); assertFalse(POSITIVE.isEmpty()); assertFalse(NEGATIVE.isEmpty()); assertFalse(A .isEmpty()); assertFalse(B .isEmpty()); assertFalse(INTEGERS.isEmpty()); }
public boolean isEmpty() { if (minValue == null || maxValue == null) { return false; } final int c = minValue.compareTo(maxValue); if (c < 0) { return false; } return c != 0 || !isMinIncluded || !isMaxIncluded; }
Range implements Serializable { public boolean isEmpty() { if (minValue == null || maxValue == null) { return false; } final int c = minValue.compareTo(maxValue); if (c < 0) { return false; } return c != 0 || !isMinIncluded || !isMaxIncluded; } }
Range implements Serializable { public boolean isEmpty() { if (minValue == null || maxValue == null) { return false; } final int c = minValue.compareTo(maxValue); if (c < 0) { return false; } return c != 0 || !isMinIncluded || !isMaxIncluded; } Range(final Class<T> elementClass, final T value);  Range(final Class<T> elementClass, final T minValue, final T maxValue);  Range(final Class<T> elementClass,
                 final T minValue, final boolean isMinIncluded,
                 final T maxValue, final boolean isMaxIncluded); }
Range implements Serializable { public boolean isEmpty() { if (minValue == null || maxValue == null) { return false; } final int c = minValue.compareTo(maxValue); if (c < 0) { return false; } return c != 0 || !isMinIncluded || !isMaxIncluded; } Range(final Class<T> elementClass, final T value);  Range(final Class<T> elementClass, final T minValue, final T maxValue);  Range(final Class<T> elementClass,
                 final T minValue, final boolean isMinIncluded,
                 final T maxValue, final boolean isMaxIncluded); Class<T> getElementClass(); T getMinValue(); boolean isMinIncluded(); T getMaxValue(); boolean isMaxIncluded(); boolean isEmpty(); boolean contains(final Comparable<?> value); boolean contains(final Range<?> range); boolean intersects(final Range<?> range); Range<?> intersect(final Range<?> range); Range<?>[] subtract(final Range<?> range); Range<?> union(final Range<?> range); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString(); }
Range implements Serializable { public boolean isEmpty() { if (minValue == null || maxValue == null) { return false; } final int c = minValue.compareTo(maxValue); if (c < 0) { return false; } return c != 0 || !isMinIncluded || !isMaxIncluded; } Range(final Class<T> elementClass, final T value);  Range(final Class<T> elementClass, final T minValue, final T maxValue);  Range(final Class<T> elementClass,
                 final T minValue, final boolean isMinIncluded,
                 final T maxValue, final boolean isMaxIncluded); Class<T> getElementClass(); T getMinValue(); boolean isMinIncluded(); T getMaxValue(); boolean isMaxIncluded(); boolean isEmpty(); boolean contains(final Comparable<?> value); boolean contains(final Range<?> range); boolean intersects(final Range<?> range); Range<?> intersect(final Range<?> range); Range<?>[] subtract(final Range<?> range); Range<?> union(final Range<?> range); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString();  }