@Test
  public void testRegionOperations() throws CacheException {

    int threshold = 4;

    final String name = getUniqueName();
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.LOCAL);
    factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(threshold));

    Region region;
    if (usingMain) {
      DistributedSystem system = DistributedSystem.connect(new Properties());
      Cache cache = CacheFactory.create(system);
      region = cache.createRegion("Test", factory.create());

    } else {
      region = createRegion(name, factory.create());
    }

    EvictionCounters lruStats = getLRUStats(region);
    assertNotNull(lruStats);

    String sampleKey = "10000";
    int stringSize = getObjectHeaderSize() // String object
        + (2 * 4) + JvmSizeUtils.getReferenceSize(); // 2 ints and a reference on a string
    stringSize = roundUpSize(stringSize);

    int charArraySize = sampleKey.length() * 2 + getObjectHeaderSize() // char array
                                                                       // object
        + 4; // length of char array
    charArraySize = roundUpSize(charArraySize);
    assertEquals(stringSize, ReflectionSingleObjectSizer.sizeof(String.class));
    assertEquals(roundUpSize(getObjectHeaderSize() + 4),
        (new ReflectionSingleObjectSizer()).sizeof(new char[0]));
    assertEquals(charArraySize, (new ReflectionSingleObjectSizer()).sizeof(new char[5]));

    int keySize = stringSize + charArraySize;
    assertEquals(keySize, WellKnownClassSizer.sizeof(sampleKey));
    assertEquals(keySize, ObjectSizer.DEFAULT.sizeof(sampleKey));
    // now that keys are inlined the keySize is 0
    keySize = 0;
    byte[] sampleValue = new byte[1000];
    int valueSize = sampleValue.length + getObjectHeaderSize() // byte array object;
        + 4; // length of byte array
    valueSize = roundUpSize(valueSize);
    int entrySize = keySize + valueSize + getEntryOverhead(region);
    assertEquals(valueSize, ObjectSizer.DEFAULT.sizeof(sampleValue));

    for (int i = 1; i <= 100; i++) {
      Object key = String.valueOf(10000 + i);
      Object value = new byte[1000];
      region.put(key, value);
      assertEquals(i * entrySize, lruStats.getCounter());
      assertEquals(0, lruStats.getEvictions());
    }

    for (int i = 100; i >= 1; i--) {
      Object key = String.valueOf(10000 + i);
      region.destroy(key);
      assertEquals((i - 1) * entrySize, lruStats.getCounter());
      assertEquals(0, lruStats.getEvictions());
    }
  }
Carefully verifies that region operations effect the {@link EvictionCounters} as expected.
geode-core/src/distributedTest/java/org/apache/geode/cache30/MemLRUEvictionControllerDUnitTest.java