     return self[MyRange(start: bounds.startIndex, end: bounds.endIndex)]
   }
 }
+*/
 
 extension MyForwardCollectionType {
   /// Do not use this method directly; call advancedBy(n) instead.

  public typealias Index = Collection.Index
  public typealias SubSequence = DefaultForwardIndexRange<Collection>
  public typealias UnownedHandle = DefaultForwardIndexRange<Collection>

  public init(
    collection: Collection,

  }
}
*/

//------------------------------------------------------------------------
// Bubble sort

extension MyMutableCollectionType
  where
  IndexRange.Generator.Element == Index,
  IndexRange.Index == Index
{
  public mutating func bubbleSortInPlace(
    @noescape isOrderedBefore: (Generator.Element, Generator.Element) -> Bool
  ) {
    if isEmpty { return }
    if next(startIndex) == endIndex { return }

    while true {
      var swapped = false
      for i in OldSequence(indices) {
        if i == endIndex { break }
        let ni = next(i)
        if ni == endIndex { break }
        if isOrderedBefore(self[ni], self[i]) {
          swap(&self[i], &self[ni])
          swapped = true
        }
      }
      if !swapped {
        break
      }
    }
  }
}

extension MyMutableCollectionType
  where
  Generator.Element : Comparable,
  IndexRange.Generator.Element == Index,
  IndexRange.Index == Index
{
  public mutating func bubbleSortInPlace() {
    bubbleSortInPlace { $0 < $1 }
  }
}

//------------------------------------------------------------------------
// Bubble sort

extension MyRandomAccessCollectionType
  where
  IndexRange.Generator.Element == Index,
  IndexRange.Index == Index
{
  public func lowerBoundOf(
    element: Generator.Element,
    @noescape isOrderedBefore: (Generator.Element, Generator.Element) -> Bool
  ) -> Index {
    var low = startIndex
    var subrangeCount = count
    while subrangeCount != 0 {
      let midOffset = subrangeCount / 2
      let mid = advance(low, by: midOffset)
      if isOrderedBefore(self[mid], element) {
        low = next(mid)
        subrangeCount -= midOffset + 1
      } else {
        subrangeCount = midOffset
      }
    }
    return low
  }
}

extension MyRandomAccessCollectionType
  where
  Generator.Element : Comparable,
  IndexRange.Generator.Element == Index,
  IndexRange.Index == Index
{
  public func lowerBoundOf(element: Generator.Element) -> Index {
    return lowerBoundOf(element) { $0 < $1 }
  }
}

//------------

public protocol MyStrideable : Comparable {
