public static <T extends PsiPolyVariantReference> JavaResolveResult @NotNull [] resolveWithContainingFile(@NotNull T ref,
                                                                                                            @NotNull ResolveCache.PolyVariantContextResolver<T> resolver,
                                                                                                            boolean needToPreventRecursion,
                                                                                                            boolean incompleteCode,
                                                                                                            @NotNull PsiFile containingFile) {
    Project project = containingFile.getProject();
    ResolveResult[] results = ResolveCache.getInstance(project).resolveWithCaching(ref, resolver, needToPreventRecursion, incompleteCode,
                                                                                   containingFile);
    return results.length == 0 ? JavaResolveResult.EMPTY_ARRAY : (JavaResolveResult[])results;
  }
public static <T extends PsiPolyVariantReference> JavaResolveResult @NotNull [] resolveWithContainingFile(@NotNull T ref,
                                                                                                            @NotNull ResolveCache.PolyVariantContextResolver<T> resolver,
                                                                                                            boolean needToPreventRecursion,
                                                                                                            boolean incompleteCode,
                                                                                                            @NotNull PsiFile containingFile)