### Question:
TimeWindowProcessMessage implements ProcessMessage { @Override public void end() { isInterrupted = true; timer.cancel(); } TimeWindowProcessMessage(ConnectorQueryData queryData, ResultsetCreator resultsetCreator); @Override void processMessage(Row row); @Override void end(); void sendMessages();  }### Answer:
@Test public void testEnd() throws Exception { Timer timer = mock(Timer.class); Whitebox.setInternalState(timeWindowProcessMessage, "timer", timer); timeWindowProcessMessage.end(); assertTrue("Is interrupted", (boolean) Whitebox.getInternalState(timeWindowProcessMessage, "isInterrupted")); verify(timer, times(1)).cancel(); }