     /// - Parameters:
     ///   - session: The session that no longer has any outstanding requests.
     public func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {
-        
+        sessionDidFinishedEvents?(session)
     }
 #endif
 }


/// Custom session delegate class for URLSession's callbacks and operations.
public final class SessionDelegate: NSObject {
    /// Closure for `urlSession(_:didBecomeInvalidWithError:)` function in protocol `URLSessionDelegate`.
    public var sessionDidBecomeInvalid: SessionDidBecomeInvalid?
    /// Closure for `urlSession(_:didReceive:completionHandler:)` function in protocol `URLSessionDelegate`.

    public var downloadTaskOfSessionDidResume: DownloadTaskOfSessionDidResume?
    
    /// Closure for `urlSession(_:readClosedFor:)` function in protocol `URLSessionStreamDelegate`.
    @available(iOS 9.0, OSX 10.11, *)
    public var streamTaskOfSessionReadClosed: StreamTaskOfSessionReadClosed? {
        get {
            return _streamTaskOfSessionReadClosed as? StreamTaskOfSessionReadClosed
        }
        set {
            _streamTaskOfSessionReadClosed = newValue
        }
    }
    /// Closure for `urlSession(_:writeClosedFor:)` function in protocol `URLSessionStreamDelegate`.
    @available(iOS 9.0, OSX 10.11, *)
    public var streamTaskOfSessionWriteClosed: StreamTaskOfSessionWriteClosed? {
        get {
            return _streamTaskOfSessionWriteClosed as? StreamTaskOfSessionWriteClosed
        }
        set {
            _streamTaskOfSessionWriteClosed = newValue
        }
    }
    /// Closure for `urlSession(_:betterRouteDiscoveredFor:)` function in protocol `URLSessionStreamDelegate`.
    @available(iOS 9.0, OSX 10.11, *)
    public var streamTaskOfSessionBetterRouteDiscovered: StreamTaskOfSessionBetterRouteDiscovered? {
        get {
            return _streamTaskOfSessionBetterRouteDiscovered as? StreamTaskOfSessionBetterRouteDiscovered
        }
        set {
            _streamTaskOfSessionBetterRouteDiscovered = newValue
        }
    }
    /// Closure for `urlSession(_streamTask:didBecome:outputStream:)` function in protocol `URLSessionStreamDelegate`.
    @available(iOS 9.0, OSX 10.11, *)
    public var streamTaskOfSessionDidBecomeInOutStream: StreamTaskOfSessionDidBecomeInOutStream? {
        get {
            return _streamTaskOfSessionDidBecomeInOutStream as? StreamTaskOfSessionDidBecomeInOutStream
        }
        set {
            _streamTaskOfSessionDidBecomeInOutStream = newValue
        }
    }
    private var _taskOfSessionDidFinishCollecting:         Any?
    private var _dataTaskOfSessionDidBecomeStreamTask:     Any?
    private var _streamTaskOfSessionReadClosed:            Any?
    private var _streamTaskOfSessionWriteClosed:           Any?
    private var _streamTaskOfSessionBetterRouteDiscovered: Any?
    private var _streamTaskOfSessionDidBecomeInOutStream:  Any?
    // MARK: URLCredential
    ///
    public var credentialOfChallenge: ((URLSession, URLSessionTask?, URLAuthenticationChallenge) -> URLCredential?)?
