public static Pair<List<? extends PsiElement>, String> askToRenameProperty(PsiMember m) {
    if (m instanceof GrAccessorMethod) {
      return member(((GrAccessorMethod)m).getProperty());
    }
    final String name;
    if (m instanceof GrMethod) {
      name = GroovyPropertyUtils.getPropertyNameByAccessorName(m.getName());
      if (name == null) return member(m);
    }
    else if (m instanceof GrField) {
      name = m.getName();
      if (!((GrField)m).isProperty()) return member(m);
    }
    else {
      return member(m);
    }

    final PsiClass containingClass = m.getContainingClass();
    if (containingClass == null) return member(m);
    final boolean isStatic = m.hasModifierProperty(PsiModifier.STATIC);

    List<PsiElement> property = new ArrayList<>();
    assert name != null;
    ContainerUtil.addAll(property, GroovyPropertyUtils.getAllGetters(containingClass, name, isStatic, false));
    ContainerUtil.addAll(property, GroovyPropertyUtils.getAllSetters(containingClass, name, isStatic, false));

    for (Iterator<PsiElement> iterator = property.iterator(); iterator.hasNext(); ) {
      if (iterator.next() instanceof GrAccessorMethod) iterator.remove();
    }

    final PsiField field = containingClass.findFieldByName(name, false);
    if (field != null) {
      property.add(field);
    }
    if (property.size() == 1) return member(m);

    if (ApplicationManager.getApplication().isUnitTestMode()) {
      return property(property, name);
    }

    AskDialog dialog = new AskDialog(m);
    dialog.show();
    if (dialog.getExitCode() == DialogWrapper.CANCEL_EXIT_CODE) return cancel();
    if (dialog.renameProperty()) return property(property, name);
    return member(m);
  }
public static Pair<List<? extends PsiElement>, String> askToRenameProperty(PsiMember m)