public static void validateInputStreamContract(InputStream inputStream) throws Exception {
    int numBytes = 8;
    byte[] bytes = new byte[numBytes];
    assertException(NullPointerException.class, () -> inputStream.read(null, 0, 5), null);
    assertException(IndexOutOfBoundsException.class, () -> inputStream.read(bytes, -1, 5), null);
    assertException(IndexOutOfBoundsException.class, () -> inputStream.read(bytes, 0, -1), null);
    assertException(IndexOutOfBoundsException.class, () -> inputStream.read(bytes, numBytes, 1), null);
    assertException(IndexOutOfBoundsException.class, () -> inputStream.read(bytes, 1, numBytes), null);
    Assert.assertEquals(0, inputStream.read(bytes, 0, 0));
  }
Verify that the {@code inputStream} satisfies basic properties of the contract.
@param inputStream
@throws Exception
ambry-test-utils/src/main/java/com/github/ambry/utils/TestUtils.java