public void testNonEmpty_write_partial_fromMiddle_byteArray() throws IOException {
      fillContent("22222222");
      assertEquals(3, file.write(3, buffer("111")));
      assertContentEquals("22211122", file);
      assertEquals(2, file.write(5, bytes("333333"), 1, 2));
      assertContentEquals("22211332", file);
    }
Actual test cases for testing RegularFiles.
jimfs/src/test/java/com/google/common/jimfs/RegularFileTest.java