void () { configure(); final Collection<PsiCallExpression> methodCallExpressions = PsiTreeUtil.findChildrenOfType(getFile(), PsiCallExpression.class); for (PsiCallExpression expression : methodCallExpressions) { dropCaches(); if (expression instanceof PsiMethodCallExpression) { assertNotNull("Failed to resolve: " + expression.getText(), expression.resolveMethod()); } assertNotNull("Failed inference for: " + expression.getText(), expression.getType()); } final Collection<PsiNewExpression> parameterLists = PsiTreeUtil.findChildrenOfType(getFile(), PsiNewExpression.class); for (PsiNewExpression newExpression : parameterLists) { dropCaches(); final PsiType[] arguments = newExpression.getTypeArguments(); String failMessage = "Failed inference for: " + newExpression.getParent().getText(); assertNotNull(failMessage, arguments); PsiDiamondType diamondType = PsiDiamondType.getDiamondType(newExpression); if (diamondType != null) { JavaResolveResult staticFactory = diamondType.getStaticFactory(); assertNotNull(staticFactory); assertTrue(staticFactory instanceof MethodCandidateInfo); assertNull(failMessage, ((MethodCandidateInfo)staticFactory).getInferenceErrorMessage()); } } }