Location<PsiMethod> (@NotNull Location contextLocation) { Location<PsiMethod> methodLocation = getTestMethod(contextLocation); if (methodLocation == null) return null; if (contextLocation instanceof PsiMemberParameterizedLocation) { PsiClass containingClass = ((PsiMemberParameterizedLocation)contextLocation).getContainingClass(); if (containingClass != null) { methodLocation = MethodLocation.elementInClass(methodLocation.getPsiElement(), containingClass); } } return methodLocation; }