stem.Collections.Generic.KeyValuePair<TKey, TValue>> GetEnumerator()
    {
        return new IKeyValuePairEnumerator(this.items, this.firstItemIndex, this.lastItemIndex);
    }

    public void Split(out global::System.Collections.Generic.IReadOnlyDictionary<TKey, TValue> firstPartition, out global::System.Collections.Generic.IReadOnlyDictionary<TKey, TValue> secondPartition)
    {
        if (Count < 2)
        {
            firstPartition = null;
            secondPartition = null;
            return;
        }

        int pivot = (int)(((long)firstItemIndex + (long)lastItemIndex) / (long)2);

        firstPartition = new ConstantSplittableMap<TKey, TValue>(items, firstItemIndex, pivot);
        secondPartition = new ConstantSplittableMap<TKey, TValue>(items, pivot + 1, lastItemIndex);
    }

    //#region IReadOnlyDictionary members

    int Find(ref TKey key)
    {
        global::System.Collections.Generic.KeyValuePair<TKey, TValue> searchKey = new global::System.Collections.Generic.KeyValuePair<TKey, TValue>(key, default(TValue));
        
        return global::System.Array.BinarySearch(items, firstItemIndex, Count, searchKey, this);
    }

    public bool ContainsKey(TKey key)
    {
        return Find(ref key) >= 0;
    }

    public bool TryGetValue(TKey key, out TValue value)
    {
        int index = Find(ref key);

        if (index < 0)
        {
            value = default(TValue);
            return false;
        }

        value = items[index].Value;
        return true;
    }

    public TValue this[TKey key]
    {
        get
        {
            return Lookup(key);
        }
    }

    public global::System.Collections.Generic.IEnumerable<TKey> Keys
    {
        get
        {
            throw new global::System.NotImplementedException("NYI");
        }
    }

    public global::System.Collections.Generic.IEnumerable<TValue> Values
    {
        get
        {
            throw new global::System.NotImplementedException("NYI");
        }
    }

    //#endregion IReadOnlyDictionary members

    #region IKeyValuePair Enumerator

    internal class IKeyValuePairEnumerator : global::System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>
    {
        private global::System.Collections.Generic.KeyValuePair<TKey, TValue>[] _array;
        private int _start;
        private int _end;
        private int _current;

        internal IKeyValuePairEnumerator(System.Collections.Generic.KeyValuePair<TKey, TValue>[] items, int first, int end)
        {
            //Contract.Requires(items != null);
            //Contract.Requires(first >= 0);
            //Contract.Requires(end >= 0);
            //Contract.Requires(first < items.Length);
            //Contract.Requires(end < items.Length);

            _array = items;
            _start = first;
            _end = end;
            _current = _start - 1;
        }

        public bool MoveNext()
        {
            if