private static void registerAnnotation(@Nullable PsiAnnotation annotation,
                                         @Nullable PsiModifierListOwner listOwner,
                                         @NotNull List<PsiAnnotation> physical,
                                         @NotNull List<PsiModifierListOwner> externalOwners) {
    if (annotation == null) return;

    if (AnnotationUtil.isExternalAnnotation(annotation)) {
      ContainerUtil.addIfNotNull(externalOwners, listOwner);
    }
    else {
      physical.add(annotation);
    }
  }
private static void registerAnnotation(@Nullable PsiAnnotation annotation,
                                         @Nullable PsiModifierListOwner listOwner,
                                         @NotNull List<PsiAnnotation> physical,
                                         @NotNull List<PsiModifierListOwner> externalOwners)