public void testNonEmpty_write_overwrite_sameLength() throws IOException {
      fillContent("2222");
      assertEquals(4, file.write(0, buffer("1234")));
      assertContentEquals("1234", file);
    }
Actual test cases for testing RegularFiles.
jimfs/src/test/java/com/google/common/jimfs/RegularFileTest.java