public void RemoveTest() { ImmutableSegmentedList <int> list = ImmutableSegmentedList <int> .Empty; for (int i = 1; i <= 10; i++) { list = list.Add(i * 10); } list = list.Remove(30); Assert.Equal(9, list.Count); Assert.False(list.Contains(30)); list = list.Remove(100); Assert.Equal(8, list.Count); Assert.False(list.Contains(100)); list = list.Remove(10); Assert.Equal(7, list.Count); Assert.False(list.Contains(10)); var removeList = new int[] { 20, 70 }; list = list.RemoveAll(removeList.Contains); Assert.Equal(5, list.Count); Assert.False(list.Contains(20)); Assert.False(list.Contains(70)); System.Collections.Immutable.IImmutableList <int> list2 = ImmutableSegmentedList <int> .Empty; for (int i = 1; i <= 10; i++) { list2 = list2.Add(i * 10); } list2 = System.Collections.Immutable.ImmutableList.Remove(list2, 30); Assert.Equal(9, list2.Count); Assert.False(list2.Contains(30)); list2 = System.Collections.Immutable.ImmutableList.Remove(list2, 100); Assert.Equal(8, list2.Count); Assert.False(list2.Contains(100)); list2 = System.Collections.Immutable.ImmutableList.Remove(list2, 10); Assert.Equal(7, list2.Count); Assert.False(list2.Contains(10)); list2 = list2.RemoveAll(removeList.Contains); Assert.Equal(5, list2.Count); Assert.False(list2.Contains(20)); Assert.False(list2.Contains(70)); }