@SuppressWarnings({ "ClassReferencesSubclass" })
    public static void copy(@NotNull PsiFile file1, @NotNull XPathFile file2) {
        final ContextProvider contextProvider = getContextProvider(file1);
        if (!(contextProvider instanceof DefaultProvider)) {
            contextProvider.attachTo(file2);
        }
    }
@SuppressWarnings({ "ClassReferencesSubclass" })
    public static void copy(@NotNull PsiFile file1, @NotNull XPathFile file2)