### Question:
UserMessageHandler implements MessageHandler<UserMessage> { @Override public void handle(UserMessage userMessage) { userMessage.perform(stateManager); } UserMessageHandler(StateManager stateManager); @Override void handle(UserMessage userMessage);  }### Answer:
@Test void verifyHandlingOfUserMessage() { userMessageHandler.handle(userMessageMock); ArgumentCaptor<StateManager> stationTransactionsManagerCaptor = ArgumentCaptor.forClass(StateManager.class); verify(userMessageMock).perform(stationTransactionsManagerCaptor.capture()); assertThat(stateManagerMock).isEqualTo(stationTransactionsManagerCaptor.getValue()); }