@Test
  public void testHFileBlockSize() throws IOException {
    long expected;
    long actual;

    actual = HFileContext.FIXED_OVERHEAD;
    expected = ClassSize.estimateBase(HFileContext.class, false);
    assertEquals(expected, actual);

    actual = HFileBlock.FIXED_OVERHEAD;
    expected = ClassSize.estimateBase(HFileBlock.class, false);
    assertEquals(expected, actual);

    actual = ExclusiveMemHFileBlock.FIXED_OVERHEAD;
    expected = ClassSize.estimateBase(ExclusiveMemHFileBlock.class, false);
    assertEquals(expected, actual);

    actual = SharedMemHFileBlock.FIXED_OVERHEAD;
    expected = ClassSize.estimateBase(SharedMemHFileBlock.class, false);
    assertEquals(expected, actual);
  }
Testing the classes that implements HeapSize and are a part of 0.20. Some are not tested here
for example BlockIndex which is tested in TestHFile since it is a non public class
hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHeapSize.java