 
     /// Network activity change notification closure typealias.
     public typealias NetworkActivityClosure = (change: NetworkActivityChangeType) -> ()
-    
+
     /// Represents an HTTP method.
     public enum Method {
         case GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, TRACE, CONNECT

        self.stubBehavior = stubBehavior
        self.networkActivityClosure = networkActivityClosure
    }
    
    /// Returns an Endpoint based on the token, method, and parameters by invoking the endpointsClosure.
    public func endpoint(token: T) -> Endpoint<T> {
        return endpointClosure(token)
    }
    
    /// Designated request-making method.
    public func request(token: T, completion: MoyaCompletion) -> Cancellable {
        let endpoint = self.endpoint(token)

/// Internal token that can be used to cancel requests
struct CancellableToken: Cancellable {
    let cancelAction: () -> ()

    func cancel() {
        cancelAction()
    }
