### Question:
MessageRouter implements MessageHandler<TypedMessage>, ApplicationListener<ContextRefreshedEvent> { @Override public void handle(final TypedMessage typedMessage) throws MessageHandlingException { final Set<MessageSender<TypedMessage>> routesForMessageType = routes.get(typedMessage.getType()); if (routesForMessageType != null) { for (final MessageSender<TypedMessage> messageSender : routesForMessageType) { messageSender.send(typedMessage); } } else { logger.warn("Unable to route message of type : " + typedMessage.getType()); } } MessageRouter(final TypedMessageListener typedMessageListener); void addRoute(final String messageType, final MessageSender<TypedMessage> messageSender); @Override void handle(final TypedMessage typedMessage); @Override void onApplicationEvent(final ContextRefreshedEvent event);  }### Answer:
@Test public void shoudIgnoreUnroutedMessageType_onHandle() { final TypedMessage mockMessage = mock(TypedMessage.class); final String messageType = Randoms.randomString(); when(mockMessage.getType()).thenReturn(messageType); final TypedMessageListener mockMessageListener = mock(TypedMessageListener.class); final MessageRouter messageRouter = new MessageRouter(mockMessageListener); Exception thrownException = null; try { messageRouter.handle(mockMessage); } catch (final Exception e) { thrownException = e; } assertNull(thrownException); }