code: public static boolean isStoreMetadata(Metadata metadata, InternalCacheEntry ice) {
        return metadata != null
              && (ice == null || isEntryMetadataAware(ice))
              && (metadata.version() != null
                        || !(metadata instanceof EmbeddedMetadata));
     }
docs: Indicates whether the entire metadata object needs to be stored or not.
  
  This check is done to avoid keeping the entire metadata object around
  when only lifespan or maxIdle time is stored. If more information
  needs to be stored (i.e. version), or the metadata object is not the
  embedded one, keep the entire metadata object around.
  
  @return true if the entire metadata object needs to be stored, otherwise
  simply store lifespan and/or maxIdle in existing cache entries