@Unretained(ENTRY_EVENT_OLD_VALUE)
  Object basicGetOldValue() {
    @Unretained(ENTRY_EVENT_OLD_VALUE)
    Object result = oldValue;
    if (result == null) {
      byte[] bytes = oldValueBytes;
      if (bytes != null) {
        result = CachedDeserializableFactory.create(bytes, getRegion().getCache());
        oldValue = result;
      }
    }
    if (!offHeapOk && isOffHeapReference(result)) {
      // this.region.getCache().getLogger().info("DEBUG old value already freed " +
      // System.identityHashCode(result));
      throw new IllegalStateException(
          "Attempt to access off heap value after the EntryEvent was released.");
    }
    return result;
  }
Note if v might be an off-heap reference that you did not retain for this EntryEventImpl then
call retainsAndSetOldValue instead of this method.

@param v the caller should have already retained this off-heap reference.
geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java