public List<CompactionTask> produce() {

        // get all CF files sorted by key range start (L1+)
        List<SstFileMetaData> sstSortedByCfAndStartingKeys =
                metadataSupplier.get().stream()
                        .filter(l -> l.level() > 0) // let RocksDB deal with L0
                        .sorted(SST_COMPARATOR)
                        .collect(Collectors.toList());
        LOG.trace("Input files: {}", sstSortedByCfAndStartingKeys.size());

        List<CompactionTask> tasks = groupIntoTasks(sstSortedByCfAndStartingKeys);
        tasks.sort(Comparator.<CompactionTask>comparingInt(t -> t.files.size()).reversed());
        return tasks.subList(0, Math.min(tasks.size(), settings.maxManualCompactions));
    }
@Test
    void testMaxFilesToCompact() {
        assertThat(
                        produce(
                                configBuilder().setMaxFilesToCompact(1).build(),
                                sstBuilder().build(),
                                sstBuilder().build()))
                .hasSize(2);
    }