    @Test
    public void testClose() throws Exception {

        // because our tests use ByteArrayInputStream, close has no effect on it.
        // But close does have an effect on our in-memory data - closing the stream closes reads to the in-memory data
        BinaryData binaryData = new BinaryData(buildByteArray("123"), buildInputStream(""));

        // show we can start reading
        Assert.assertEquals(3, binaryData.available());
        Assert.assertEquals('1', binaryData.read());
        Assert.assertEquals(2, binaryData.available());

        // show that close worked
        binaryData.close();
        Assert.assertEquals(0, binaryData.available());
        Assert.assertEquals(-1, binaryData.read());
    }