Set<PsiClassType> (final CommonProblemDescriptor @NotNull [] problems, final @NotNull PsiElementFactory factory) { return StreamEx.of(problems) .select(ProblemDescriptor.class) .map(ProblemDescriptor::getPsiElement) .select(PsiJavaCodeReferenceElement.class) .map(factory::createType) .toSet(); }