private static @Nullable PsiFile moveAnnotationsAndGetFile(@NotNull PsiPackageStatement packageStatement,
                                                             @NotNull PsiFile packageInfoFile) {
    PsiPackageStatement packageStatementInPackageInfoFile = PsiTreeUtil.findChildOfType(packageInfoFile, PsiPackageStatement.class);
    if (packageStatementInPackageInfoFile == null) {
      PsiPackageStatement copy = (PsiPackageStatement)packageStatement.copy();
      deleteAnnotations(copy);
      packageStatementInPackageInfoFile = (PsiPackageStatement)packageInfoFile.addBefore(copy, packageInfoFile.getFirstChild());
    }
    PsiModifierList missingAnnotations = findMissingAnnotations(packageStatement, packageStatementInPackageInfoFile);
    if (missingAnnotations == null) return null;
    PsiModifierList annotationList = packageStatementInPackageInfoFile.getAnnotationList();
    if (annotationList != null) {
      StreamEx.of(missingAnnotations.getAnnotations()).forEach(annotationList::add);
    }
    else {
      packageStatementInPackageInfoFile.addBefore(missingAnnotations, packageStatementInPackageInfoFile.getFirstChild());
    }
    CodeStyleManager.getInstance(packageInfoFile.getProject()).reformat(packageInfoFile);
    return packageInfoFile;
  }
private static @Nullable PsiFile moveAnnotationsAndGetFile(@NotNull PsiPackageStatement packageStatement,
                                                             @NotNull PsiFile packageInfoFile)