@Test
  public void testObjectSizerForHeapLRU_CustomizedNonSizerObject() throws Exception {
    prepareScenario(EvictionAlgorithm.LRU_HEAP, new TestObjectSizerImpl());

    // Size of overhead= 49
    // Size of Integer key= 0(inlined)
    // Size of byte array 0 + size of overhead(16)
    // Total Size of each entry should be= 54
    putCustomizedData(1, new byte[0]);
    {
      int keySize = 0;
      int valueSize = JvmSizeUtils.getObjectHeaderSize() + 4 /* array length */ + 0 /* bytes */;
      valueSize = roundUpSize(valueSize);
      int entrySize = keySize + valueSize
          + ((HeapLRUController) ((PartitionedRegion) region).getEvictionController())
              .getPerEntryOverhead();
      assertEquals(entrySize, getSizeOfCustomizedData(1));
    }

    // Size of overhead= 49
    // Size of Integer key= 0(inlined)
    // Size of byte array 4 + size of overhead(12)
    // Total Size of each entry should be= 59
    putCustomizedData(2, new byte[4]);
    {
      int keySize = 0;
      int valueSize = JvmSizeUtils.getObjectHeaderSize() + 4 /* array length */ + 4 /* bytes */;
      valueSize = roundUpSize(valueSize);
      int entrySize = keySize + valueSize
          + ((HeapLRUController) ((PartitionedRegion) region).getEvictionController())
              .getPerEntryOverhead();
      assertEquals(entrySize, getSizeOfCustomizedData(2));
    }
  }
With object sizer for customized value object implementing ObjectSizer .Key -Integer Value
TestNonSizerObject
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/eviction/EvictionObjectSizerDUnitTest.java