boolean (final @NotNull PsiMethod patternMethod, @NotNull PsiElement container) { final String name = patternMethod.getName(); Map<String, Boolean> cached = CachedValuesManager.getCachedValue(container, () -> Result.create( (ConcurrentMap<String, Boolean>)new ConcurrentHashMap<String, Boolean>(), PsiModificationTracker.MODIFICATION_COUNT )); Boolean cachedResult = cached.get(name); if (cachedResult != null) { return cachedResult.booleanValue(); } boolean result = doCheckContainer(patternMethod, container, name); cached.put(name, result); return result; }