@Override
  public void onStreamRequest(StreamRequest req,
      RequestContext requestContext,
      Map<String, String> wireAttrs,
      NextFilter<StreamRequest, StreamResponse> nextFilter)
  {
    disruptRequest(req, requestContext, wireAttrs, nextFilter);
  }
@Test
  public void testExecutorRejectExecution() throws Exception
  {
    final AtomicBoolean success = new AtomicBoolean(false);
    final CountDownLatch latch = new CountDownLatch(1);

    ExecutorService rejectedExecutor = EasyMock.createStrictMock(ExecutorService.class);
    rejectedExecutor.execute(EasyMock.anyObject(Runnable.class));
    EasyMock.expectLastCall().andAnswer(() -> {
      success.set(true);
      latch.countDown();
      throw new RejectedExecutionException();
    });

    EasyMock.replay(rejectedExecutor);

    final RequestContext requestContext = new RequestContext();
    requestContext.putLocalAttr(DISRUPT_CONTEXT_KEY, DisruptContexts.error(REQUEST_LATENCY));

    final DisruptFilter filter = new DisruptFilter(_scheduler, rejectedExecutor, REQUEST_TIMEOUT, _clock);
    final NextFilter<StreamRequest, StreamResponse> next = new NextFilter<StreamRequest, StreamResponse>()
    {
      @Override
      public void onRequest(StreamRequest restRequest, RequestContext requestContext, Map<String, String> wireAttrs)
      {
        success.set(false);
        latch.countDown();
      }

      @Override
      public void onResponse(StreamResponse restResponse, RequestContext requestContext, Map<String, String> wireAttrs)
      {
        success.set(false);
        latch.countDown();
      }

      @Override
      public void onError(Throwable ex, RequestContext requestContext, Map<String, String> wireAttrs)
      {
        success.set(false);
        latch.countDown();
      }
    };

    filter.onStreamRequest(new StreamRequestBuilder(
            new URI(URI)).build(EntityStreams.emptyStream()),
        requestContext,
        Collections.emptyMap(), next);
    Assert.assertTrue(latch.await(TEST_TIMEOUT, TimeUnit.MILLISECONDS), "Missing NextFilter invocation");
    Assert.assertTrue(success.get(), "Unexpected method invocation");

    EasyMock.verify(rejectedExecutor);
    EasyMock.reset(rejectedExecutor);
  }