public static UsageInfo @NotNull [] findUsages(@NotNull PsiElement element,
                                                 String newName,
                                                 @NotNull SearchScope searchScope,
                                                 boolean searchInStringsAndComments,
                                                 boolean searchForTextOccurrences,
                                                 Map<? extends PsiElement, String> allRenames) {
    List<UsageInfo> result = Collections.synchronizedList(new ArrayList<>());

    RenamePsiElementProcessorBase elementProcessor = RenamePsiElementProcessorBase.forPsiElement(element);

    processUsages(element, elementProcessor, newName, searchScope, true, searchInStringsAndComments, searchForTextOccurrences, info -> {
                    result.add(info);
                    return true;
                  }
    );

    elementProcessor.findCollisions(element, newName, allRenames, result);

    return result.toArray(UsageInfo.EMPTY_ARRAY);
  }
public static UsageInfo @NotNull [] findUsages(@NotNull PsiElement element,
                                                 String newName,
                                                 @NotNull SearchScope searchScope,
                                                 boolean searchInStringsAndComments,
                                                 boolean searchForTextOccurrences,
                                                 Map<? extends PsiElement, String> allRenames)