docs: protected List<OneItemset> buildFrequentOneItemsets(final Relation<? extends SparseFeatureVector<?>> relation, final int dim, final int needed) {
      // TODO: use TIntList and prefill appropriately to avoid knowing "dim"
      // beforehand?
      int[] counts = new int[dim];
      for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {
        SparseFeatureVector<?> bv = relation.get(iditer);
        for(int it = bv.iter(); bv.iterValid(it); it = bv.iterAdvance(it)) {
          counts[bv.iterDim(it)]++;
        }
      }
      if(LOG.isStatistics()) {
        LOG.statistics(new LongStatistic(STAT + "1-items.candidates", dim));
      }
      // Generate initial candidates of length 1.
      List<OneItemset> frequent = new ArrayList<>(dim);
      for(int i = 0; i < dim; i++) {
        if(counts[i] >= needed) {
          frequent.add(new OneItemset(i, counts[i]));
        }
      }
      return frequent;
    }