### Question:
PolicyV1Filter implements Filter { @Override public Promise<QueryResponse, ResourceException> filterQuery(final Context context, final QueryRequest request, final QueryResourceHandler handler, final RequestHandler next) { return next.handleQuery(context, request, new QueryResourceHandler() { @Override public boolean handleResource(ResourceResponse resource) { final JsonValue jsonValue = resource.getContent(); jsonValue.remove(RESOURCE_TYPE_UUID); return handler.handleResource(resource); } }); } @Inject  PolicyV1Filter(final ApplicationServiceFactory applicationServiceFactory,
                          final ExceptionMappingHandler<EntitlementException, ResourceException> resourceErrorHandler,
                          final ContextHelper contextHelper,
                          @Named("frRest") final Debug debug); @Override Promise<ActionResponse, ResourceException> filterAction(Context context, ActionRequest request,
            RequestHandler next); @Override Promise<ResourceResponse, ResourceException> filterCreate(Context context, CreateRequest request,
            RequestHandler next); @Override Promise<ResourceResponse, ResourceException> filterUpdate(Context context, UpdateRequest request,
            RequestHandler next); @Override Promise<ResourceResponse, ResourceException> filterDelete(Context context, DeleteRequest request,
            RequestHandler next); @Override Promise<QueryResponse, ResourceException> filterQuery(final Context context,
            final QueryRequest request, final QueryResourceHandler handler, final RequestHandler next); @Override Promise<ResourceResponse, ResourceException> filterRead(Context context, ReadRequest request,
            RequestHandler next); @Override Promise<ResourceResponse, ResourceException> filterPatch(Context context, PatchRequest request,
            RequestHandler next);  }### Answer:
@Test public void forwardOnQuery() { QueryRequest queryRequest = mock(QueryRequest.class); when(requestHandler.handleQuery(any(Context.class), any(QueryRequest.class), queryResultHandlerCaptor.capture())).thenReturn(Promises.<QueryResponse, ResourceException>newResultPromise(newQueryResponse())); Promise<QueryResponse, ResourceException> promise = filter.filterQuery(context, queryRequest, queryResultHandler, requestHandler); assertThat(promise).succeeded(); verify(requestHandler).handleQuery(eq(context), eq(queryRequest), queryResultHandlerCaptor.capture()); exerciseTransformationHandler(queryResultHandlerCaptor.getValue()); }