/// <summary> /// Retrieves the maximum key and the associated value. /// </summary> /// <returns>The tuple of the maximum key, associated value and the /// dictionary containing all other elements, if the dictionary is /// non-empty; <c>None</c> otherwise.</returns> public Optional <Tuple <TKey, TValue> > MaxKeyAndValue() { if (Count == 0) { return(Optional <Tuple <TKey, TValue> > .None); } if (Count == 1) { return(Optional.Some(Tuple.New(_key, _value))); } return(_right.MaxKeyAndValue()); }