ReduceResult (@NotNull PsiType selectorType, @NotNull PsiElement context) { Set<PatternTypeTestDescription> consideredDescription = StreamEx.of(patterns).select(PatternTypeTestDescription.class).collect(Collectors.toSet()); if (consideredDescription.isEmpty()) { return new ReduceResult(patterns, changed()); } ReduceResult result = CachedValuesManager.getCachedValue(context, () -> { Map<ReduceResultCacheContext, ReduceResult> map = ConcurrentFactoryMap.createMap( reduceContext -> reduceContext.reduceClassesInner(context)); return CachedValueProvider.Result.create(map, PsiModificationTracker.MODIFICATION_COUNT); }).get(new ReduceResultCacheContext(selectorType, patterns)); return !result.changed() ? this : result; }