@Override
  protected UsageInfo @NotNull [] findUsages() {
    ArrayList<UsageInfo> result = new ArrayList<>();

    if (!mySettings.generateDelegate() && toSearchFor != null) {
      Collection<PsiReference> refs;
      if (toSearchFor instanceof GrField) {
        refs = ReferencesSearch.search(toSearchFor).findAll();
        final GrAccessorMethod[] getters = ((GrField)toSearchFor).getGetters();
        for (GrAccessorMethod getter : getters) {
          refs.addAll(MethodReferencesSearch.search(getter, getter.getResolveScope(), true).findAll());
        }
      }
      else if (toSearchFor instanceof GrVariable) {
        refs = findUsagesForLocal(toReplaceIn, ((GrVariable)toSearchFor));
      }
      else {
        refs = ReferencesSearch.search(toSearchFor).findAll();
      }

      for (PsiReference ref1 : refs) {
        PsiElement ref = ref1.getElement();
        if (!PsiTreeUtil.isAncestor(toReplaceIn, ref, false)) {
          result.add(new ExternalUsageInfo(ref));
        }
        else {
          result.add(new ChangedMethodCallInfo(ref));
        }
      }

      if (toSearchFor instanceof GrVariable && !((GrVariable)toSearchFor).hasModifierProperty(PsiModifier.FINAL)) {
        setPreviewUsages(true);
      }
    }

    if (mySettings.replaceAllOccurrences()) {
      PsiElement[] exprs = GroovyIntroduceParameterUtil.getOccurrences(mySettings);
      for (PsiElement expr : exprs) {
        result.add(new InternalUsageInfo(expr));
      }
    }
    else {
      if (mySettings.getExpression() != null) {
        result.add(new InternalUsageInfo(mySettings.getExpression()));
      }
    }

    final UsageInfo[] usageInfos = result.toArray(UsageInfo.EMPTY_ARRAY);
    return UsageViewUtil.removeDuplicatedUsages(usageInfos);
  }
@Override
  protected UsageInfo @NotNull [] findUsages()