@Released(ENTRY_EVENT_NEW_VALUE)
  protected void basicSetNewValue(@Retained(ENTRY_EVENT_NEW_VALUE) Object v,
      boolean clearCachedSerializedAndBytes) {
    if (v == newValue) {
      return;
    }
    if (mayHaveOffHeapReferences()) {
      if (offHeapOk) {
        OffHeapHelper.releaseAndTrackOwner(newValue, this);
      }
      if (StoredObject.isOffHeapReference(v)) {
        ReferenceCountHelper.setReferenceCountOwner(this);
        if (!((StoredObject) v).retain()) {
          ReferenceCountHelper.setReferenceCountOwner(null);
          newValue = null;
          return;
        }
        ReferenceCountHelper.setReferenceCountOwner(null);
      }
    }
    newValue = v;
    if (clearCachedSerializedAndBytes) {
      newValueBytes = null;
      cachedSerializedNewValue = null;
    }
  }
If new value is off-heap return the StoredObject form (unretained OFF_HEAP_REFERENCE). Its
refcount is not inced by this call and the returned object can only be safely used for the
lifetime of the EntryEventImpl instance that returned the value. Else return the raw form.
geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java