@Test public void intersectsTest() { assertTrue("[0..10[ intersects [5..15[", Range.between(0, 10) .intersects(Range.between(5, 15))); assertTrue("[0..10[ does not intersect [10..20[", !Range.between(0, 10) .intersects(Range.between(10, 20))); }
public boolean intersects(final Range other) { return getStart() < other.getEnd() && other.getStart() < getEnd(); }
Range implements Serializable { public boolean intersects(final Range other) { return getStart() < other.getEnd() && other.getStart() < getEnd(); } }
Range implements Serializable { public boolean intersects(final Range other) { return getStart() < other.getEnd() && other.getStart() < getEnd(); } private  Range(final int start, final int end); }
Range implements Serializable { public boolean intersects(final Range other) { return getStart() < other.getEnd() && other.getStart() < getEnd(); } private  Range(final int start, final int end); static Range withOnly(final int integer); static Range between(final int start, final int end); static Range withLength(final int start, final int length); int getStart(); int getEnd(); int length(); boolean isEmpty(); boolean intersects(final Range other); boolean contains(final int integer); boolean isSubsetOf(final Range other); Range[] partitionWith(final Range other); Range offsetBy(final int offset); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); boolean startsBefore(final Range other); boolean endsBefore(final Range other); boolean endsAfter(final Range other); boolean startsAfter(final Range other); Range[] splitAt(final int integer); Range[] splitAtFromStart(final int length); Range combineWith(Range other); Range expand(int startDelta, int endDelta); Range restrictTo(Range bounds); }
Range implements Serializable { public boolean intersects(final Range other) { return getStart() < other.getEnd() && other.getStart() < getEnd(); } private  Range(final int start, final int end); static Range withOnly(final int integer); static Range between(final int start, final int end); static Range withLength(final int start, final int length); int getStart(); int getEnd(); int length(); boolean isEmpty(); boolean intersects(final Range other); boolean contains(final int integer); boolean isSubsetOf(final Range other); Range[] partitionWith(final Range other); Range offsetBy(final int offset); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); boolean startsBefore(final Range other); boolean endsBefore(final Range other); boolean endsAfter(final Range other); boolean startsAfter(final Range other); Range[] splitAt(final int integer); Range[] splitAtFromStart(final int length); Range combineWith(Range other); Range expand(int startDelta, int endDelta); Range restrictTo(Range bounds);  }