@Test public void testIsConsecutive() { R range = getTestRange(from("10"), to("20")); verifyNotConsecutiveRanges(range, getTestRange(from("5"), to("8"))); verifyConsecutiveRanges(range, getTestRange(from("5"), to("9"))); verifyNotConsecutiveRanges(range, getTestRange(from("5"), to("10"))); verifyNotConsecutiveRanges(range, getTestRange(from("5"), to("15"))); verifyNotConsecutiveRanges(range, getTestRange(from("10"), to("15"))); verifyNotConsecutiveRanges(range, getTestRange(from("15"), to("19"))); verifyNotConsecutiveRanges(range, getTestRange(from("15"), to("20"))); verifyNotConsecutiveRanges(range, getTestRange(from("15"), to("25"))); verifyNotConsecutiveRanges(range, getTestRange(from("20"), to("25"))); verifyConsecutiveRanges(range, getTestRange(from("21"), to("25"))); verifyNotConsecutiveRanges(range, getTestRange(from("22"), to("25"))); verifyNotConsecutiveRanges(range, getTestRange(from("5"), to("25"))); verifyNotConsecutiveRanges(range, getTestRange(from("10"), to("20"))); assertFalse(range.isConsecutive((R) null)); verifyNotConsecutiveRanges(range, getFullRange()); }
@Override public boolean isConsecutive(R other) { if (other == null) { return false; } else { return (end.hasNext() && end.next().equals(other.start())) || (other.end().hasNext() && other.end().next().equals(this.start)); } }
AbstractRange implements Range<C, R> { @Override public boolean isConsecutive(R other) { if (other == null) { return false; } else { return (end.hasNext() && end.next().equals(other.start())) || (other.end().hasNext() && other.end().next().equals(this.start)); } } }
AbstractRange implements Range<C, R> { @Override public boolean isConsecutive(R other) { if (other == null) { return false; } else { return (end.hasNext() && end.next().equals(other.start())) || (other.end().hasNext() && other.end().next().equals(this.start)); } } protected  AbstractRange(C start, C end); }
AbstractRange implements Range<C, R> { @Override public boolean isConsecutive(R other) { if (other == null) { return false; } else { return (end.hasNext() && end.next().equals(other.start())) || (other.end().hasNext() && other.end().next().equals(this.start)); } } protected  AbstractRange(C start, C end); @Override C start(); @Override C end(); @Override boolean contains(R other); @Override boolean contains(C value); @Override boolean overlaps(R other); @Override boolean isConsecutive(R other); @Override boolean isEmpty(); @Override R merge(R other); @Override R intersection(R other); @SuppressWarnings({"unchecked"}) @Override List<R> exclude(R other); @Override boolean isSameRange(R other); @Override String toString(); @Override Iterator<C> iterator(); @Override final boolean equals(Object o); @Override final int hashCode(); }
AbstractRange implements Range<C, R> { @Override public boolean isConsecutive(R other) { if (other == null) { return false; } else { return (end.hasNext() && end.next().equals(other.start())) || (other.end().hasNext() && other.end().next().equals(this.start)); } } protected  AbstractRange(C start, C end); @Override C start(); @Override C end(); @Override boolean contains(R other); @Override boolean contains(C value); @Override boolean overlaps(R other); @Override boolean isConsecutive(R other); @Override boolean isEmpty(); @Override R merge(R other); @Override R intersection(R other); @SuppressWarnings({"unchecked"}) @Override List<R> exclude(R other); @Override boolean isSameRange(R other); @Override String toString(); @Override Iterator<C> iterator(); @Override final boolean equals(Object o); @Override final int hashCode();  }