public virtual void TestIteratorThrowsOnConcurrentModification() { object[] elements = { "foo", "bar" }; var queue = NewQueue(elements); var iterator = queue.Iterator(); Iterator4Assert.AssertNext("foo", iterator); queue.Add("baz"); Assert.AreEqual("foo", iterator.Current, "accessing current element should be harmless" ); Assert.Expect(typeof(InvalidOperationException), new _ICodeBlock_31(iterator)); }