@Override
  public void aroundWriteTo(WriterInterceptorContext ctx)
      throws IOException, WebApplicationException {
    try {
      ctx.proceed();
    } finally {
      TrackedByGauge trackedByGauge = _resourceInfo.getResourceMethod().getAnnotation(TrackedByGauge.class);
      if (trackedByGauge != null) {
        _controllerMetrics.addValueToGlobalGauge(trackedByGauge.gauge(), -1L);
      }
    }
  }
@Test
  public void testWriterInterceptorDecrementsGauge()
      throws Exception {
    Method methodOne = TrackedClass.class.getDeclaredMethod("trackedMethod");
    when(_resourceInfo.getResourceMethod()).thenReturn(methodOne);
    _interceptor.aroundWriteTo(_writerInterceptorContext);
    verify(_controllerMetrics)
        .addValueToGlobalGauge(ControllerGauge.SEGMENT_DOWNLOADS_IN_PROGRESS, -1L);
  }