code: public static Object getCachedValue(Record record) {
          for (; ; ) {
              Object cachedValue = record.getCachedValueUnsafe();
              if (!(cachedValue instanceof Thread)) {
                  return cachedValue;
              }
  
              cachedValue = ThreadWrapper.unwrapOrNull(cachedValue);
              if (cachedValue != null) {
                  return cachedValue;
              }
          }
      }
docs: Get current cached value from the record.
  This method protects you against accidental exposure of cached value mutex into rest of the code.
  <p/>
  Use it instead of raw {@link Record#getCachedValueUnsafe()} See
  {@link #getValueOrCachedValue(Record, SerializationService)}
  for details.
  
  @param record
  @return