### Question:
FilteringMessageReader implements MessageReader { @Override public void delete(MessageEvent event) { try { delegate.delete(event); log.debug("Message deleted successfully"); } catch (Exception e) { log.error("Could not delete message from queue: ", e); } } FilteringMessageReader(MessageReader delegate, TableSelector tableSelector); @Override Optional<MessageEvent> read(); @Override void delete(MessageEvent event); @Override void close();  }### Answer:
@Test public void typicalDelete() { filteringMessageReader = new FilteringMessageReader(delegate, tableSelector); filteringMessageReader.delete(messageEvent1); verify(delegate).delete(messageEvent1); }
@Test public void deleteThrowsException() { filteringMessageReader = new FilteringMessageReader(delegate, tableSelector); doThrow(new RuntimeException()).when(delegate) .delete(any()); filteringMessageReader.delete(messageEvent1); verify(delegate).delete(messageEvent1); }