@Test
  public void getHeapFormOfSerializedStoredObjectReturnsDeserializedObject() {
    allocateOffHeapSerialized();
    Object heapObject = OffHeapHelper.getHeapForm(storedObject);
    assertThat("getHeapForm returns non-null object", heapObject, notNullValue());
    assertThat("Heap and off heap objects are different objects", heapObject,
        is(not(storedObject)));
    assertThat("Deserialzed values of offHeap object and returned object are equal", heapObject,
        is(equalTo(deserializedRegionEntryValue)));
  }
Extracted from JUnit setUp() to reduce test overhead for cases where offheap memory isn't
needed.
geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapHelperJUnitTest.java