Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
Expand Down Expand Up @@ -225,7 +226,8 @@ private KOptMoveInfo setupValidNonsequential4OptMove(KOptListMoveIteratorMockDat
Map<Object, Integer> entityToListSize = Arrays.stream(entities)
.collect(Collectors.toMap(Function.identity(),
entity -> 2,
Integer::sum));
Integer::sum,
LinkedHashMap::new));
Comment on lines +229 to +230

Copilot AI Jan 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is incomplete. The same non-deterministic issue exists in the setupValidOddSequentialKOptMove method at lines 134-137, where entityToListSize is also created using Collectors.toMap without specifying LinkedHashMap::new as the map supplier. Both methods iterate over entityToListSize.entrySet() (line 142 in setupValidOddSequentialKOptMove, line 235 in this method) and rely on the iteration order matching the entities array order for correctness. The setupValidOddSequentialKOptMove method should receive the same fix to ensure full test determinism.

Copilot uses AI. Check for mistakes.
Map<Object, List<Object>> entityToList = new HashMap<>();
Map<Object, Integer> entityToOffset = new HashMap<>();

Expand Down