function wrapCast(cast, name) {
    if (typeof cast !== 'function' || cast.name === '__NR_wrappedCast') {
      return cast
    }

    const CAST_SEGMENT_NAME = 'Promise.' + name
    // eslint-disable-next-line camelcase
    return function __NR_wrappedCast() {
      const transaction = agent.tracer.getTransaction()
      const parent = agent.tracer.getSegment()
      const segment = _createSegment({ name: CAST_SEGMENT_NAME, transaction, parent })
      const prom = cast.apply(this, arguments)
      if (segment) {
        Contextualizer.link(null, prom, segment, transaction)
      }
      return prom
    }
  }
Creates a wrapper around the static `Promise` factory method.

@param {Function} cast reference of function to wrap
@param {string} name name of the function being wrapped
@returns {Function} wrapped function