@Test
  public void testTransferFrom_noBytesNoAllocation() throws IOException {
    // Similar to the previous test but ensures that if no bytes are transferred at all, no new
    // blocks remain allocated.
    // https://github.com/google/jimfs/issues/163
    byte[] bytes = new byte[0];
    RegularFile file = createFile();

    long transferred =
        file.transferFrom(Channels.newChannel(new ByteArrayInputStream(bytes)), 0, Long.MAX_VALUE);
    assertThat(transferred).isEqualTo(0);
    assertThat(file.blockCount()).isEqualTo(0);
  }
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