PsiTypeParameterListOwner (@NotNull PsiMethod method, PsiElement gParent) { PsiTypeParameterListOwner owner = null; if (method.getTypeParameters().length > 0 && gParent instanceof PsiCallExpression && ((PsiCallExpression)gParent).getTypeArgumentList().getTypeParameterElements().length == 0) { owner = method; } else if (method.isConstructor() && gParent instanceof PsiNewExpression) { final PsiClass containingClass = method.getContainingClass(); if (containingClass != null && containingClass.hasTypeParameters() && PsiDiamondType.hasDiamond((PsiNewExpression)gParent)) { owner = containingClass; } } return owner; }