private void WriteEnd(ODataWriter writer, ODataReaderState expectedState)
 {
     this.expectedStates.Add(expectedState);
     writer.WriteEnd();
     writer.Flush();
 }