@Override
  public PsiElement getElementToRefactor(PsiElement element) {
    if (element instanceof PsiNewExpression newExpression) {
      PsiAnonymousClass anonymousClass = newExpression.getAnonymousClass();
      if (anonymousClass != null) return anonymousClass;
    }
    return element instanceof PsiClass ? element : element.getParent();
  }
@Override
  public PsiElement getElementToRefactor(PsiElement element)