@NotNull
  static List<FileContent> collectContents(@NotNull Project project,
                                           @Nullable Editor editor,
                                           @Nullable VirtualFile file,
                                           VirtualFile @Nullable [] files) {
    boolean isBackedFile = file instanceof BackedVirtualFile;
    if (editor != null) {
      String content = getContentFromEditor(editor, isBackedFile);
      if (content != null) {
        if (file != null) {
          return Collections.singletonList(new FileContent(file.getName(), content));
        }
        else {
          return Collections.singletonList(new FileContent("", content));
        }
      }
    }
    if (files != null) {
      List<FileContent> contents = new ArrayList<>();
      for (VirtualFile vf : files) {
        contents.addAll(getContentFromFile(vf, project, null));
      }
      return contents;
    }

    if (file != null) {
      return getContentFromFile(file, project, null);
    }

    LOG.error("File, files and editor can't be null all at once!");
    throw new IllegalStateException("File, files and editor can't be null all at once!");
  }
@NotNull
  static List<FileContent> collectContents(@NotNull Project project,
                                           @Nullable Editor editor,
                                           @Nullable VirtualFile file,
                                           VirtualFile @Nullable [] files)