### Question:
EventResource { @GET @Path("/{event}") @ApiOperation("Get event handlers for a given event") public List<EventHandler> getEventHandlersForEvent(@PathParam("event") String event, @QueryParam("activeOnly") @DefaultValue("true") boolean activeOnly) { return eventService.getEventHandlersForEvent(event, activeOnly); } @Inject  EventResource(EventService eventService); @POST @ApiOperation("Add a new event handler.") void addEventHandler(EventHandler eventHandler); @PUT @ApiOperation("Update an existing event handler.") void updateEventHandler(EventHandler eventHandler); @DELETE @Path("/{name}") @ApiOperation("Remove an event handler") void removeEventHandlerStatus(@PathParam("name") String name); @GET @ApiOperation("Get all the event handlers") List<EventHandler> getEventHandlers(); @GET @Path("/{event}") @ApiOperation("Get event handlers for a given event") List<EventHandler> getEventHandlersForEvent(@PathParam("event") String event,
                                                       @QueryParam("activeOnly") @DefaultValue("true") boolean activeOnly); @GET @Path("/queues") @ApiOperation("Get registered queues") Map<String, ?> getEventQueues(@QueryParam("verbose") @DefaultValue("false") boolean verbose); @GET @Path("/queues/providers") @ApiOperation("Get registered queue providers") List<String> getEventQueueProviders();  }### Answer:
@Test public void testGetEventHandlersForEvent() { EventHandler eventHandler = new EventHandler(); eventResource.addEventHandler(eventHandler); List<EventHandler> listOfEventHandler = new ArrayList<>(); listOfEventHandler.add(eventHandler); when(mockEventService.getEventHandlersForEvent(anyString(), anyBoolean())).thenReturn(listOfEventHandler); assertEquals(listOfEventHandler, eventResource.getEventHandlersForEvent("testEvent", true)); }