@Test
  public void testTransferFrom() throws IOException {
    // Test that when a transferFrom ends on a block boundary because the input has no further bytes
    // and not because count bytes have been transferred, we don't leave an extra empty block
    // allocated on the end of the file.
    // https://github.com/google/jimfs/issues/163
    byte[] bytes = new byte[BLOCK_SIZE];
    RegularFile file = createFile();

    long transferred =
        file.transferFrom(Channels.newChannel(new ByteArrayInputStream(bytes)), 0, Long.MAX_VALUE);
    assertThat(transferred).isEqualTo(bytes.length);
    assertThat(file.blockCount()).isEqualTo(1);
  }
Tests for the lower-level operations dealing with the blocks of a {@link RegularFile}.

@author Colin Decker
jimfs/src/test/java/com/google/common/jimfs/RegularFileBlocksTest.java