     ///
     /// - returns: All elements of sequence.
     public func toArray() throws -> [E] {
-        let results = convertToArray()
+        let results = materializeResult()
         return try elementsOrThrow(results)
     }
 }

    ///
    /// - returns: First element of sequence. If sequence is empty `nil` is returned.
    public func first() throws -> E? {
        let results = convertToArray(max: 1)
        return try elementsOrThrow(results).first
    }
}

    ///
    /// - returns: On completion, returns the list of elements in the sequence. On error, returns the list of elements up to that point, along with the error itself.
    public func materialize() -> SequenceMaterializeResult<E> {
        return materializeResult()
    }
}

extension BlockingObservable {
    fileprivate func materializeResult(max: Int? = nil, predicate: @escaping (E) throws -> Bool = { _ in true }) -> SequenceMaterializeResult<E> {
        var elements: [E] = Array<E>()
        var error: Swift.Error?
        
