Closed MatthewRueben closed 3 weeks ago
Gah! I forgot that Collections2::orderedPermutations
returns an ImmutableList
(but calls it a List
even though you can't call, e.g., removeFirst()
on it?!)...ok, but I figured out an easy way to make a (mutable) ArrayList
with the same contents. cf02148f82f14d8fe05c8473833640a1fc58333c
Maybe I don't even need to make a copy since (1) we don't try to modify field
ID
, and it'sfinal
anyway, (2) we don't try to delete any sock objects, and you can't really do that in Java, anyway, and (3) the sock sequence is already in a separateList
from the one in theinstances
field of aMatchablePool
, so removing it from the first list doesn't make it eligible for garbage collection yet. Try it!