@Test
  public void testRead_partialArray_invalidInput() throws IOException {
    JimfsInputStream in = newInputStream(1, 2, 3, 4, 5);

    try {
      in.read(new byte[3], -1, 1);
      fail();
    } catch (IndexOutOfBoundsException expected) {
    }

    try {
      in.read(new byte[3], 0, 4);
      fail();
    } catch (IndexOutOfBoundsException expected) {
    }

    try {
      in.read(new byte[3], 1, 3);
      fail();
    } catch (IndexOutOfBoundsException expected) {
    }
  }
Tests for {@link JimfsInputStream}.

@author Colin Decker
jimfs/src/test/java/com/google/common/jimfs/JimfsInputStreamTest.java