void (final PsiMethodCallExpression methodCallExpression, final PsiType typeParameterValue) { final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); final JavaResolveResult methodResolve = methodExpression.advancedResolve(false); assertTrue(methodResolve.getElement() instanceof PsiMethod); final PsiMethod methodSort = (PsiMethod) methodResolve.getElement(); assertEquals("sort", methodSort.getName()); assertEquals("test.CollectionUtil", methodSort.getContainingClass().getQualifiedName()); final PsiTypeParameter methodSortTypeParameter = methodSort.getTypeParameters()[0]; final PsiType sortParameterActualType = methodResolve.getSubstitutor().substitute(methodSortTypeParameter); assertTrue(Comparing.equal(sortParameterActualType, typeParameterValue)); assertTrue( PsiUtil.isApplicable(methodSort, methodResolve.getSubstitutor(), methodCallExpression.getArgumentList())); }