void (@NotNull PsiJavaCodeReferenceElement reference) { super.visitReferenceElement(reference); final PsiElement resolved = reference.resolve(); if (resolved instanceof PsiTypeParameter typeParameter) { final PsiTypeParameterListOwner owner = typeParameter.getOwner(); if (owner != null && !PsiTreeUtil.isAncestor(myAnonOrLocalClass, owner, false) && (CommonJavaRefactoringUtil.isInStaticContext(owner, myTargetClass) || myMakeStatic)) { myTypeParametersToCreate.add(typeParameter); } } }