List<InspectionProfileEntry> (Set<String> classNames) { List<InspectionProfileEntry> tools = JBIterable.of(LocalInspectionEP.LOCAL_INSPECTION, InspectionEP.GLOBAL_INSPECTION) .flatten(o -> o.getExtensionList()) .filter(o -> classNames.contains(o.implementationClass)) .transform(InspectionEP::instantiateTool) .toList(); if (tools.size() != classNames.size()) { Set<String> missing = new TreeSet<>(classNames); missing.removeAll(JBIterable.from(tools).transform(o -> o.getClass().getName()).toSet()); throw new RuntimeException("Unregistered inspections requested: " + missing); } return tools; }