### Question:
TaskResponseService { @PreDestroy public void stop(){ this.taskResponseWorker.interrupt(); if(!eventQueue.isEmpty()){ List<TaskResponseEvent> remainEvents = new ArrayList<>(eventQueue.size()); eventQueue.drainTo(remainEvents); for(TaskResponseEvent event : remainEvents){ this.persist(event); } } }  @PostConstruct void start(); @PreDestroy void stop(); void addResponse(TaskResponseEvent taskResponseEvent); BlockingQueue<TaskResponseEvent> getEventQueue();  }### Answer:
@Test public void testStop(){ TaskResponseEvent taskResponseEvent = TaskResponseEvent.newAck(ExecutionStatus.RUNNING_EXECUTION, new Date(), "", "", "", 1); taskResponseService.addResponse(taskResponseEvent); taskResponseService.stop(); Assert.assertTrue(taskResponseService.getEventQueue().size() == 0); }