void () { final Project project = getProject(); final String severityName = "X"; final TextAttributesKey attributesKey = TextAttributesKey.createTextAttributesKey(severityName); final HighlightSeverity severity = new HighlightSeverity(severityName, 50); final var textAttributes = new SeverityRegistrar.SeverityBasedTextAttributes( new TextAttributes(null, Color.PINK, null, null, Font.PLAIN), new HighlightInfoType.HighlightInfoTypeImpl(severity, attributesKey) ); final SeverityRegistrar registrar = SeverityRegistrar.getSeverityRegistrar(project); registrar.registerSeverity(textAttributes, null); Disposer.register(getTestRootDisposable(), () -> registrar.unregisterSeverity(severity)); final InspectionProfileImpl profile = InspectionProfileManager.getInstance(project).getCurrentProfile(); profile.setErrorLevel(HighlightDisplayKey.find("Convert2Diamond"), HighlightDisplayLevel.find(severity), project); assertEquals(severity, profile.getErrorLevel(HighlightDisplayKey.find("Convert2Diamond"), null).getSeverity()); configureFromFileText("test.java", """ import java.util.ArrayList; import java.util.List; class Foo { public List<String> foo() { List<String> list = new ArrayList<String>(); return list; } } """); final List<HighlightInfo> highlighting = ContainerUtil.filter( doHighlighting(), highlightInfo -> Objects.requireNonNullElse(highlightInfo.getDescription(),"").startsWith("Explicit type argument ") ); assertSize(1, highlighting); final HighlightInfo info = highlighting.get(0); assertEquals(severity, info.getSeverity()); assertEquals(HighlighterLayer.WARNING, info.getHighlighter().getLayer()); }