private static long objectToAddress(@Unretained Object v) {
      if (v instanceof StoredObject) {
        return ((StoredObject) v).getAddress();
      }
      if (v == null) {
        return NULL_ADDRESS;
      }
      if (v == Token.TOMBSTONE) {
        return TOMBSTONE_ADDRESS;
      }
      if (v == Token.INVALID) {
        return INVALID_ADDRESS;
      }
      if (v == Token.LOCAL_INVALID) {
        return LOCAL_INVALID_ADDRESS;
      }
      if (v == Token.DESTROYED) {
        return DESTROYED_ADDRESS;
      }
      if (v == Token.REMOVED_PHASE1) {
        return REMOVED_PHASE1_ADDRESS;
      }
      if (v == Token.REMOVED_PHASE2) {
        return REMOVED_PHASE2_ADDRESS;
      }
      if (v == Token.END_OF_STREAM) {
        return END_OF_STREAM_ADDRESS;
      }
      if (v == Token.NOT_AVAILABLE) {
        return NOT_AVAILABLE_ADDRESS;
      }
      throw new IllegalStateException("Can not convert " + v + " to an off heap address.");
    }
If the value stored at the location held in 're' is returned, then it will be Retained. If the
value returned is 're' decompressed into another off-heap location, then 're' will be
Unretained but the new, decompressed value will be Retained. Therefore, whichever is returned
(the value at the address in 're' or the decompressed value) it will have been Retained.

@return possible OFF_HEAP_OBJECT (caller must release)
geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapRegionEntryHelperInstance.java