public static GenericCollection <TItem> ScrambleWordList <TItem>(this GenericCollection <TItem> collection) { var selectedWords = collection.Where(w => random.Next(0, 2) == 0).ToArray(); var initialSize = collection.Count; collection.Clear(); for (int i = 0; i < initialSize; i++) { var selectedIndex = random.Next(0, selectedWords.Length); collection.Add(selectedWords[selectedIndex]); } return(collection); }