ArrayByteSequence implements Serializable, Comparable<ArrayByteSequence> { public ArrayByteSequence subSequence(final int start, final int end) { if (start > end || start < 0 || end > length) { throw new IllegalArgumentException("Bad start and/end start = " + start + " end=" + end + " offset=" + offset + " length=" + length); } return new ArrayByteSequence(data, offset + start, end - start); } ArrayByteSequence(final byte[] data);  ArrayByteSequence(final byte[] data, final int offset, final int length);  ArrayByteSequence(final String s);  ArrayByteSequence(final ByteBuffer buffer); byte byteAt(final int i); byte[] getBackingArray(); boolean isBackedByArray(); int length(); int offset(); byte[] toArray(); String toString(); ArrayByteSequence subSequence(final int start, final int end); static int compareBytes(final ArrayByteSequence bs1, final ArrayByteSequence bs2); int compareTo(final ArrayByteSequence obs); boolean equals(final Object o); int hashCode();  }
@Test public void testSubSequence() { assertEquals(0, abs.subSequence(0, 0).length()); assertEquals("mile", abs.subSequence(1, 5).toString()); }
@Test public void testInvalidSubsequence0ShouldThrowIAX() { assertThrows(IllegalArgumentException.class, () -> { abs.subSequence(5, 1); }); }
@Test public void testInvalidSubsequence1ShouldThrowIAX() { assertThrows(IllegalArgumentException.class, () -> abs.subSequence(-1, 1)); }
@Test public void testInvalidSubsequence3ShouldThrowIAX() { assertThrows(IllegalArgumentException.class, () -> abs.subSequence(0, 10)); }