boolean (CompletionParameters parameters, CompletionResultSet result, Set<? extends ExpectedTypeInfo> infos) { PsiElement position = parameters.getPosition(); if (SmartCastProvider.inCastContext(parameters) || !JavaSmartCompletionContributor.INSIDE_EXPRESSION.accepts(position) || !(position.getParent() instanceof PsiJavaCodeReferenceElement)) { return false; } boolean[] hadItems = new boolean[1]; for (ExpectedTypeInfo info : new ObjectOpenCustomHashSet<>(infos, JavaSmartCompletionContributor.EXPECTED_TYPE_INFO_STRATEGY)) { BasicExpressionCompletionContributor.fillCompletionVariants(new JavaSmartCompletionParameters(parameters, info), lookupElement -> { PsiType psiType = JavaCompletionUtil.getLookupElementType(lookupElement); if (psiType != null && info.getType().isAssignableFrom(psiType)) { hadItems[0] = true; result.addElement(JavaSmartCompletionContributor.decorate(lookupElement, infos)); } }, result.getPrefixMatcher()); } return hadItems[0]; }