@Test
public void buffersGivenInputStreamInMemoryWhenLengthExceedsThreshold() throws Exception {

    InputStream inputStream = new ByteArrayInputStream(testContent);
    InputStream bufferedStream = IOHelper.bufferStream(inputStream, testContent.length - 1);
    assertTrue(bufferedStream instanceof FileInputStream);
    try {
        assertArrayEquals(testContent, ByteStreams.toByteArray(bufferedStream));
    } finally {
        bufferedStream.close();
    }
}