void () { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); String filePath = BASE_PATH + getTestName(false) + ".java"; configureByFile(filePath); Collection<HighlightInfo> infos = doHighlighting(); List<String> tooltips = new ArrayList<>(); for (HighlightInfo info : infos) { if (info.getSeverity() == HighlightSeverity.ERROR) { tooltips.add(info.getToolTip()); } } boolean found = false; for (String tooltip : tooltips) { if (tooltip.contains("no instance(s) of type variable(s) K, U exist so that Map&lt;K, U&gt; conforms to Function&lt;U, V&gt;")) { found = true; break; } } if (!found) { fail(StringUtil.join(tooltips, ", ")); } }