@Test(expected=IllegalArgumentException.class)
public void toArrayWithOffsetLengthSmallCapacity() throws BufferException {

    ByteBuffer buffer = new ByteBuffer(TEST_BYTES1);
    byte[] copyArray = buffer.toArray(5, 2, 1);
}