private static String[] getUnresolvedReferences(PsiElement parentOfType, boolean referenceOnMethod, PrefixMatcher matcher) {
    if (parentOfType != null && parentOfType.getTextLength() > MAX_SCOPE_SIZE_TO_SEARCH_UNRESOLVED) return ArrayUtilRt.EMPTY_STRING_ARRAY;
    Set<String> unresolvedRefs = new LinkedHashSet<>();

    if (parentOfType != null) {
      parentOfType.accept(new JavaRecursiveElementWalkingVisitor() {
        @Override public void visitReferenceExpression(@NotNull PsiReferenceExpression reference) {
          PsiElement parent = reference.getParent();
          if (parent instanceof PsiReference || referenceOnMethod != parent instanceof PsiMethodCallExpression) return;

          String refName = reference.getReferenceName();
          if (refName != null && matcher.prefixMatches(refName) && reference.resolve() == null) {
            unresolvedRefs.add(refName);
          }
        }
      });
    }
    return ArrayUtilRt.toStringArray(unresolvedRefs);
  }
private static String[] getUnresolvedReferences(PsiElement parentOfType, boolean referenceOnMethod, PrefixMatcher matcher)