private static List<PsiFile> getFilesToWrite(PsiFile file,
                                               PsiModifierListOwner owner,
                                               ExternalAnnotationsManager externalAnnotationsManager) {
    List<PsiFile> files = externalAnnotationsManager.findExternalAnnotationsFiles(owner);
    if (files != null) {
      List<PsiFile> elements = new ArrayList<>(files);
      elements.add(file);
      return elements;
    }
    return Collections.singletonList(file);
  }
private static List<PsiFile> getFilesToWrite(PsiFile file,
                                               PsiModifierListOwner owner,
                                               ExternalAnnotationsManager externalAnnotationsManager)