boolean (CompletionParameters parameters, final CompletionResultSet result, PsiElement position) { Ref<Boolean> added = new Ref<>(); added.set(false); if (StringUtil.isNotEmpty(result.getPrefixMatcher().getPrefix())) { for (ExpectedTypeInfo info : JavaSmartCompletionContributor.getExpectedTypes(parameters)) { new CollectionsUtilityMethodsProvider(position, info.getType(), info.getDefaultType(), element -> { added.set(true); result.consume(element); }).addCompletions(true); } } return added.get(); }