void () { final String filePath = BASE_PATH + "/" + getTestName(false) + ".java"; configureByFile(filePath); PsiMethodCallExpression methodCall = PsiTreeUtil.getParentOfType(getFile().findElementAt(getEditor().getCaretModel().getOffset()), PsiMethodCallExpression.class); assertNotNull(methodCall); final PsiResolveHelper helper = JavaPsiFacade.getInstance(methodCall.getProject()).getResolveHelper(); CandidateInfo[] candidates = helper.getReferencedMethodCandidates(methodCall, false, true); for (CandidateInfo candidate : candidates) { if (candidate instanceof MethodCandidateInfo) { //try to cache top level session candidate.getSubstitutor(); } } doTestConfiguredFile(false, false, filePath); }