Cache (PsiElement psi, Key<CachedValue<Cache>> key) { CachedValue<Cache> cache = CachedValuesManager.getManager(psi.getProject()).createCachedValue( () -> CachedValueProvider.Result.create(new Cache(), PsiModificationTracker.MODIFICATION_COUNT)); cache = ((UserDataHolderEx)psi).putUserDataIfAbsent(key, cache); return cache.getValue(); }