void (PsiFile file, String prefix, int invocationCount, String... expected) { PlainTextSymbolCompletionContributor contributor = PlainTextSymbolCompletionContributorEP.forLanguage(JavaLanguage.INSTANCE); assertNotNull(contributor); Collection<LookupElement> options = contributor.getLookupElements(file, invocationCount, prefix); PrefixMatcher matcher = new PlainPrefixMatcher(prefix); assertEquals(Arrays.asList(expected), StreamEx.of(options).filter(matcher::prefixMatches).map(LookupElement::getLookupString).toList()); }