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