@Test
public void stringTest() {

    String toTest = "yopYOP\n\r";
    byte[] charData = toTest.getBytes();
    assertEquals(toTest.length(), charData.length);
    ByteBuffer myBuffer = ByteBuffer.allocate(toTest.length());
    for (int i = 0; i < toTest.length(); i++) {
        myBuffer.put(charData[i]);
    }
    myBuffer.flip();
    int remaining = myBuffer.remaining();
    int pos = myBuffer.position();
    String dump = ByteBufferDumper.dump(myBuffer);
    assertEquals("ByteBuffer[len=8,str='" + toTest + "']", dump);
    assertEquals(remaining, myBuffer.remaining());
    assertEquals(pos, myBuffer.position());
}