private TElement GetNextObservedElement <TElement>() where TElement : ODataPayloadElement { var observed = this.observedElementStack.Peek(); this.Assert.AreEqual(ODataPayloadElement.GetElementType <TElement>(), observed.ElementType, "Unexpected element type"); return((TElement)observed); }