A small module builds a badge from selected document folders. After a recent PR, the behavior started differing from what was expected: some duplicates stopped collapsing, and selection by codes started picking up extra items.
selectedNames method must return folder names in the order of first appearance in the input list.pickByCodes method must select folders only by exact code match.scala-cli run .
Main:
reports folder;List("FIN") when codes FIN and FINAL are present.reports folder, the result should contain that name once.FIN, only folders with code FIN should be included in the result, without items with similar codes like FINAL.scala-cli 1.9.1 in JVM modeMain.mainUse line comments to explain the problem, its impact, the fix and how to test it.