@Test
  public void testObjectSize() throws IOException {
    LOG.info("header:" + ClassSize.OBJECT);
    LOG.info("array header:" + ClassSize.ARRAY);

    if (ClassSize.is32BitJVM()) {
      assertEquals(ClassSize.OBJECT, 8);
    } else {
      assertTrue(ClassSize.OBJECT == 12 || ClassSize.OBJECT == 16); // depending on CompressedOops
    }
    if (ClassSize.useUnsafeLayout()) {
      assertEquals(ClassSize.ARRAY, ClassSize.OBJECT + 4);
    } else {
      assertEquals(ClassSize.ARRAY, ClassSize.OBJECT + 8);
    }
  }
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