### Question:
ArrayByteSequence extends ByteSequence implements Serializable { @Override public ByteSequence subSequence(int start, 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(byte[] data);  ArrayByteSequence(byte[] data, int offset, int length);  ArrayByteSequence(String s);  ArrayByteSequence(ByteBuffer buffer);  ArrayByteSequence(ByteSequence byteSequence); @Override byte byteAt(int i); @Override byte[] getBackingArray(); @Override boolean isBackedByArray(); @Override int length(); @Override int offset(); @Override ByteSequence subSequence(int start, int end); @Override byte[] toArray(); @Override String toString();  }### Answer:
@Test public void testSubSequence() { assertEquals(0, abs.subSequence(0, 0).length()); assertEquals("mile", abs.subSequence(1, 5).toString()); }
@Test(expected = IllegalArgumentException.class) public void testInvalidSubsequence0() { abs.subSequence(5, 1); }
@Test(expected = IllegalArgumentException.class) public void testInvalidSubsequence1() { abs.subSequence(-1, 1); }
@Test(expected = IllegalArgumentException.class) public void testInvalidSubsequence3() { abs.subSequence(0, 10); }