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

    testChannel = new TestPipeChannel();
    PipeChannelInputStream input = new PipeChannelInputStream(testChannel, Duration.ofSeconds(1));
    assertThatExceptionOfType(IndexOutOfBoundsException.class)
            .isThrownBy(() -> input.read(new byte[10], -1, 5));
    assertThatExceptionOfType(IndexOutOfBoundsException.class)
            .isThrownBy(() -> input.read(new byte[10], 0, -1));
    assertThatExceptionOfType(IndexOutOfBoundsException.class)
            .isThrownBy(() -> input.read(new byte[10], 9, 2));
    assertThatExceptionOfType(IndexOutOfBoundsException.class)
            .isThrownBy(() -> input.read(new byte[10], 11, 0));
    assertThatExceptionOfType(NullPointerException.class)
            .isThrownBy(() -> input.read(null, 0, 0));
}