@Test
  public void copyIfNeededOffHeapSerializedReturnsValueOfOriginal() {
    allocateOffHeapSerialized();
    Object returnObject = ((VMCachedDeserializable) OffHeapHelper.copyIfNeeded(storedObject, null))
        .getSerializedValue();
    assertThat(returnObject, is(equalTo(serializedRegionEntryValue)));
  }
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