private static void assertBufferEquals(String expected, int remaining, ByteBuffer actual) {
      assertBufferEquals(expected, actual);
      assertEquals(remaining, actual.remaining());
    }
Actual test cases for testing RegularFiles.
jimfs/src/test/java/com/google/common/jimfs/RegularFileTest.java