@Test
public void testEmptyReadFully() throws Exception {

  Reader reader = mock(Reader.class);
  when(reader.read(any(char[].class), anyInt(), anyInt()))
          .thenReturn(-1);
  char[] buffer = new char[10];
  try {
    IOUtils.readFully(reader, buffer, 0);
    fail();
  } catch (IOException e) {
    // expected
  }
}