@Test
  public void testFree_partialCaching() throws IOException {
    HeapDisk disk = new HeapDisk(4, 10, 4);
    disk.allocate(blocks, 6);

    disk.free(blocks, 2);

    assertThat(blocks.blockCount()).isEqualTo(4);
    assertThat(disk.getUnallocatedSpace()).isEqualTo(24);
    assertThat(disk.blockCache.blockCount()).isEqualTo(2);

    disk.free(blocks);

    assertThat(blocks.blockCount()).isEqualTo(0);
    assertThat(disk.getUnallocatedSpace()).isEqualTo(40);
    assertThat(disk.blockCache.blockCount()).isEqualTo(4);
  }
Tests for {@link HeapDisk}.

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