docs: private List<ResolveTask> collectProcessingTopics(final Collection<FileInfo> fis, final KeyScope rootScope, final Document doc) {
          final List<ResolveTask> res = new ArrayList<>();
          final FileInfo input = job.getFileInfo(fi -> fi.isInput).iterator().next();
          res.add(new ResolveTask(rootScope, input, null));
          // Collect topics from map and rewrite topicrefs for duplicates
          walkMap(doc.getDocumentElement(), rootScope, res);
          // Collect topics not in map and map itself
          for (final FileInfo f: fis) {
              if (!usage.containsKey(f.uri)) {
                  res.add(processTopic(f, rootScope, f.isResourceOnly));
              }
          }
  
          final List<ResolveTask> deduped = removeDuplicateResolveTargets(res);
          if (fileInfoFilter != null) {
              return adjustResourceRenames(deduped.stream()
                      .filter(rs -> fileInfoFilter.test(rs.in))
                      .collect(Collectors.toList()));
          } else {
              return adjustResourceRenames(deduped);
          }
      }