@Test
public void testWrappedReadForCompressedData() throws IOException {

  byte[] buf = new byte[2];
  InputStream mockStream = Mockito.mock(InputStream.class);
  Mockito.when(mockStream.read(buf, 0, 1)).thenReturn(1);
  Mockito.when(mockStream.read(buf, 0, 2)).thenThrow(
      new java.lang.InternalError());
  try {
    assertEquals("Check expected value", 1,
        IOUtils.wrappedReadForCompressedData(mockStream, buf, 0, 1));
  } catch (IOException ioe) {
    fail("Unexpected error while reading");
  }
  try {
    IOUtils.wrappedReadForCompressedData(mockStream, buf, 0, 2);
  } catch (IOException ioe) {
    GenericTestUtils.assertExceptionContains(
        "Error while reading compressed data", ioe);
  }
}