source: class ContentLengthVerifyingInputStreamTest {
  
      private static byte[] TEST_BUFFER;
  
      @Test(expected = IOException.class)
      public void readBuffer_inputStreamShorterThanExpectedLength_shouldFail() throws IOException {
  
target:         final InputStream inputStream = createInputStream(TEST_BUFFER, 2000);
          byte[] buffer = new byte[10];
          while (inputStream.read(buffer) != -1) {}
      }
  
  }