public void FindAll_VerifyDuplicates(int count)
        {
            SegmentedList <T> list = GenericListFactory(count);

            for (int i = 0; i < count / 2; i++)
            {
                list.Add(list[i]);
            }
            SegmentedList <T> beforeList = list.ToSegmentedList();
            T?            expectedItem   = default(T);
            Predicate <T> EqualsDelegate = (value) => expectedItem == null ? value == null : expectedItem.Equals(value);

            //[] Verify FindAll returns the correct List with one item
            for (int i = 0; i < count; ++i)
            {
                expectedItem = beforeList[i];
                SegmentedList <T> results = list.FindAll(EqualsDelegate);
                VerifyList(results, beforeList.Where((value) => EqualsDelegate(value)).ToSegmentedList());
            }

            //[] Verify FindAll returns an List with all of the items if the predicate always returns true
            VerifyList(list.FindAll(_alwaysTrueDelegate), beforeList);

            //[] Verify FindAll returns an empty List if the match returns false on every item
            VerifyList(list.FindAll(_alwaysFalseDelegate), new SegmentedList <T>());
        }
        public void AddRange_AddSelfAsEnumerable_ThrowsExceptionWhenNotEmpty()
        {
            SegmentedList <T?> list = GenericListFactory(0) !;

            // Succeeds when list is empty.
            list.AddRange(list);
            list.AddRange(list.Where(_ => true));

            // Succeeds when list has elements and is added as collection.
            list.Add(default);