@Test
public void testSingleByteRead()
{

    byte[] expected = "This is a test for single byte read".getBytes(UTF_8);
    List<byte[]> buffers = ImmutableList.of(
            "This ".getBytes(UTF_8),
            "is ".getBytes(UTF_8),
            "a test ".getBytes(UTF_8),
            "for".getBytes(UTF_8),
            " single byte read".getBytes(UTF_8));
    byte[] resultBuffer = new byte[expected.length];
    try (GatheringByteArrayInputStream in = new GatheringByteArrayInputStream(buffers, expected.length)) {
        for (int i = 0; i < expected.length; i++) {
            resultBuffer[i] = (byte) in.read();
        }
        assertByteArrayEquals(resultBuffer, 0, expected, 0, expected.length);
        assertEquals(in.read(), -1);
    }
}