public void testNonEmpty_read_fromPastEnd_byteArray() throws IOException {
      fillContent("123");
      byte[] array = new byte[3];
      assertEquals(-1, file.read(3, array, 0, array.length));
      assertArrayEquals(bytes("000"), array);
      assertEquals(-1, file.read(3, array, 0, 2));
      assertArrayEquals(bytes("000"), array);
    }
Actual test cases for testing RegularFiles.
jimfs/src/test/java/com/google/common/jimfs/RegularFileTest.java