@Test
public void testDeserializeStringTrailingWhitespace() {

    String string = Random.getString().trim();
    int numWhiteSpaces = Random.getScaleCount();
    string = Strings.padEnd(string, string.length() + numWhiteSpaces, ' ');
    ByteBuffer bytes = ByteBuffer
            .wrap(string.getBytes(StandardCharsets.UTF_8));
    String string2 = ByteBuffers.getString(bytes, StandardCharsets.UTF_8);
    Assert.assertEquals(string, string2);
}