@Test(timeout = 10000)
public void readSingleByte() throws IOException {

    testChannel = new TestPipeChannel();
    PipeChannelInputStream input = new PipeChannelInputStream(testChannel, Duration.ofSeconds(2));
    String msg = "Hello world!";
    byte[] msgBytes = msg.getBytes(StandardCharsets.UTF_8);
    testChannel.putInReadBuffer(msgBytes);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    int b;
    while (baos.size() < msgBytes.length && (b = input.read()) != -1) {
        baos.write(b);
    }
    assertThat(baos.toByteArray()).isEqualTo(msgBytes);
    mustBlock(input::read);
}