ToolWrappers (@Nullable PsiFile psiFile, boolean includeDoNotShow) { return new ToolWrappers( localTools.stream() .map(tool -> tool.getEnabledTool(psiFile, includeDoNotShow)) .filter(wrapper -> wrapper instanceof LocalInspectionToolWrapper) .map(wrapper -> (LocalInspectionToolWrapper)wrapper) .toList(), globalSimpleTools.stream() .map(tool -> tool.getEnabledTool(psiFile, includeDoNotShow)) .filter(wrapper -> wrapper instanceof GlobalInspectionToolWrapper) .map(wrapper -> (GlobalInspectionToolWrapper)wrapper) .toList() ); }