@Test
public void testStreamToBytes() throws Exception {

    String test = "test";
    ByteArrayInputStream bais = new ByteArrayInputStream(test.getBytes());
    byte[] arr = Misc.streamToBytes(bais);
    assertEquals("test", new String(arr, StandardCharsets.UTF_8));
}