@Test
void testPut() {

    ByteBuffer to = BufferUtils.allocate(10);
    ByteBuffer from = BufferUtils.toBuffer("12345");
    BufferUtils.clear(to);
    assertEquals(5, BufferUtils.append(to, from));
    assertTrue(BufferUtils.isEmpty(from));
    assertEquals("12345", BufferUtils.toString(to));
    from = BufferUtils.toBuffer("XX67890ZZ");
    from.position(2);
    assertEquals(5, BufferUtils.append(to, from));
    assertEquals(2, from.remaining());
    assertEquals("1234567890", BufferUtils.toString(to));
    from = BufferUtils.toBuffer("1234");
    to = BufferUtils.allocate(from.remaining() * 2);
    assertEquals(0, to.position());
    assertEquals(0, to.limit());
    assertEquals(0, from.position());
    assertEquals(4, from.limit());
    BufferUtils.append(to, from);
    assertEquals(0, to.position());
    assertEquals(4, to.limit());
    assertEquals(4, from.position());
    assertEquals(4, from.limit());
    to.get();
    from = BufferUtils.toBuffer("1234");
    BufferUtils.append(to, from);
    assertEquals(1, to.position());
    assertEquals(8, to.limit());
}