RingRange { @JsonIgnore public boolean isWrapping() { return SegmentGenerator.greaterThanOrEqual(start, end); } RingRange(BigInteger start, BigInteger end);  RingRange(String... range); BigInteger getStart(); BigInteger getEnd(); BigInteger span(BigInteger ringSize); boolean encloses(RingRange other); @JsonIgnore boolean isWrapping(); @Override String toString(); static RingRange merge(List<RingRange> ranges); static final Comparator<RingRange> START_COMPARATOR; }
@Test public void isWrappingTest() { RingRange r0To0 = new RingRange(BigInteger.valueOf(0L), BigInteger.valueOf(0L)); assertTrue(r0To0.isWrapping()); RingRange r0To1 = new RingRange(BigInteger.valueOf(0L), BigInteger.valueOf(1L)); assertFalse(r0To1.isWrapping()); RingRange r1To0 = new RingRange(BigInteger.valueOf(1L), BigInteger.valueOf(0L)); assertTrue(r1To0.isWrapping()); }