private void testKeysAndValuesOperationsOnVM(final VM vm) {
    vm.invoke(new SerializableRunnable() {
      @Override
      public void run() {
        Region<String, String> region = getCache().getRegion(REGION_NAME);

        String oldValue = region.put(KEY_1, VALUE_1);
        assertNull(oldValue);

        oldValue = region.get(KEY_1);
        assertEquals(VALUE_1, oldValue);

        region.invalidate(KEY_1);
        assertNull(region.get(KEY_1));

        oldValue = region.put(KEY_1, VALUE_1);
        assertNull(oldValue);

        oldValue = region.get(KEY_1);
        assertEquals(VALUE_1, oldValue);

        assertTrue(region.containsKey(KEY_1));
        assertTrue(region.containsValue(VALUE_1));

        region.destroy(KEY_1);
        assertNull(region.get(KEY_1));

        oldValue = region.put(KEY_1, VALUE_1);
        assertNull(oldValue);

        oldValue = region.get(KEY_1);
        assertEquals(VALUE_1, oldValue);

        oldValue = region.remove(KEY_1);
        assertEquals(VALUE_1, oldValue);

        oldValue = region.put(KEY_1, VALUE_1);
        assertNull(oldValue);

        assertTrue(region.remove(KEY_1, VALUE_1));

        oldValue = region.put(KEY_1, VALUE_1);
        assertNull(oldValue);

        oldValue = region.replace(KEY_1, VALUE_2);
        assertEquals(VALUE_1, oldValue);

        oldValue = region.get(KEY_1);
        assertEquals(VALUE_2, oldValue);

        assertTrue(region.replace(KEY_1, VALUE_2, VALUE_3));
        assertTrue(region.containsValue(VALUE_3));

        assertTrue(region.containsKey(KEY_1));
      }
    });
  }
Tests the following region key, value operations:

<ul>
<li>{@link Region#invalidate(Object)}</li>
<li>{@link Region#containsKey(Object)}</li>
<li>{@link Region#containsValue(Object)}</li>
<li>{@link Region#destroy(Object)}</li>
<li>{@link Region#remove(Object)}</li>
<li>{@link Region#remove(Object, Object)}</li>
<li>{@link Region#replace(Object, Object)}</li>
<li>{@link Region#replace(Object, Object, Object)}</li>
<li>{@link Region#values()}</li>
<li>{@link Region#keySet()}</li>
</ul>

@param vm a test virtual machine.
geode-core/src/distributedTest/java/org/apache/geode/internal/compression/CompressionRegionOperationsDUnitTest.java