void () { checkPreferredItems(0, "BAR", "FOO", "GOO"); myFixture.type("\nbreak;\ncase "); LookupElement[] items = myFixture.completeBasic(); assertPreferredItems(0, "FOO", "GOO", "BAR"); assertEquals(NormalCompletionTestCase.renderElement(items[0]).getItemTextForeground(), JBColor.foreground()); assertEquals(NormalCompletionTestCase.renderElement(ContainerUtil.find(items, it -> it.getLookupString().equals("BAR"))) .getItemTextForeground(), JBColor.RED); }