everytyime you call the getColorListShuffled()
function you initialize the array IntList inventory_1 = new IntList (cells.length);
. Meaning it cannot ever be bigger than one.
Even if its not called inside a loop, its called inside a function which is told to reset it everytime.