public void testNonEmpty_write_partial_fromStart_byteArray() throws IOException {
      fillContent("222222");
      assertEquals(3, file.write(0, bytes("111"), 0, 3));
      assertContentEquals("111222", file);
      assertEquals(2, file.write(0, bytes("333333"), 0, 2));
      assertContentEquals("331222", file);
    }
Actual test cases for testing RegularFiles.
jimfs/src/test/java/com/google/common/jimfs/RegularFileTest.java