@Override
    public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
        if (context.getEntity() instanceof ITotalSize) {
            ITotalSize sizedResults = (ITotalSize) context.getEntity();
            context.getHeaders().putIfAbsent("X-Total-Count", List.of(sizedResults.getTotalSize()));
            context.getHeaders().putIfAbsent("Total-Count", List.of(sizedResults.getTotalSize()));
        }
        context.proceed();
    }
@author Marc Savy {@literal <marc@blackparrotlabs.io>}
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/interceptors/TotalCountInterceptorProvider.java