@Override
  public @NotNull <T> CachedValue<T> createCachedValue(@NotNull UserDataHolder userDataHolder,
                                                       @NotNull CachedValueProvider<T> provider,
                                                       boolean trackValue) {
    if (preferHardRefsForPsiCachedValue
        && userDataHolder instanceof PsiElement
        && !(userDataHolder instanceof PsiFile)) { // PsiFile cache may outlive the loaded content of file
      return new PsiCachedValueImpl.Direct<>(myManager, provider, trackValue);
    }

    return createCachedValue(provider, trackValue);
  }
@Override
  public @NotNull <T> CachedValue<T> createCachedValue(@NotNull UserDataHolder userDataHolder,
                                                       @NotNull CachedValueProvider<T> provider,
                                                       boolean trackValue)