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

    testChannel = new TestPipeChannel();
    PipeChannelInputStream input = new PipeChannelInputStream(testChannel, Duration.ofSeconds(2));
    assertThat(input.available()).isZero();
    byte[] data = new byte[42];
    testChannel.putInReadBuffer(data);
    assertThat(input.available()).isEqualTo(data.length);
    input.read(data);
    assertThat(input.available()).isZero();
}