@Test
  public void closeTest() throws IOException {
    final AtomicBoolean streamOpen = new AtomicBoolean(true);
    InputStream stream = new InputStream() {
      @Override
      public int read() throws IOException {
        throw new IllegalStateException("Not implemented");
      }

      @Override
      public void close() {
        streamOpen.set(false);
      }
    };
    InputStreamReadableStreamChannel channel = new InputStreamReadableStreamChannel(stream, EXECUTOR_SERVICE);
    assertTrue("Channel should be open", channel.isOpen());
    channel.close();
    assertFalse("Channel should be closed", channel.isOpen());
    assertFalse("Stream should be closed", streamOpen.get());
    // close again is ok
    channel.close();
  }
Verifies behavior of {@link InputStreamReadableStreamChannel#close()}.
@throws IOException
ambry-commons/src/test/java/com/github/ambry/commons/InputStreamReadableStreamChannelTest.java