### Question:
ArrayByteSequence extends ByteSequence implements Serializable { @Override public String toString() { return new String(data, offset, length, UTF_8); } 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 testFromByteBuffer() { ByteBuffer bb = ByteBuffer.wrap(data, 1, 4); abs = new ArrayByteSequence(bb); assertEquals("mile", abs.toString()); bb = bb.asReadOnlyBuffer(); abs = new ArrayByteSequence(bb); assertEquals("mile", abs.toString()); }
@Test public void testToString() { assertEquals("String conversion should round trip correctly", "", new ArrayByteSequence("").toString()); }