private StoredObject convertToStoredObject(final Object tmp) {
    if (!mayHaveOffHeapReferences()) {
      return null;
    }
    if (!(tmp instanceof StoredObject)) {
      return null;
    }
    StoredObject result = (StoredObject) tmp;
    if (!result.retain()) {
      return null;
    }
    return result;
  }
If the old value is stored off-heap return a retained OFF_HEAP_REFERENCE (caller must release).

@return a retained OFF_HEAP_REFERENCE if the old value is off-heap; otherwise returns null
geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java