@Test
public void testEarlyCancel() throws Exception {

  final ThrottlingClientInterceptor underTest =
      new ThrottlingClientInterceptor(mockResourceLimiter);
  ClientCall call = underTest.interceptCall(methodDescriptor, CallOptions.DEFAULT, mockChannel);
  call.start(mockListener, new Metadata());
  call.cancel("fake cancel", null);
  ArgumentCaptor<Status> statusCaptor = ArgumentCaptor.forClass(Status.class);
  verify(mockListener, times(1)).onClose(statusCaptor.capture(), any(Metadata.class));
  Assert.assertEquals(statusCaptor.getValue().getCode(), Code.CANCELLED);
}