SenderManager { public Sender querySender(String id) { return senders.get(id); }  Sender querySender(String id); boolean sendAlert(AlertChannel channel, AlertMessageEntity message);  }
@Test public void querySender() throws Exception { Sender sender = senderManager.querySender(EmailSender.ID); Assert.assertTrue(sender instanceof EmailSender); AlertChannel channel = AlertChannel.MAIL; String id = channel.getId(); sender = senderManager.querySender(id); Assert.assertTrue(sender instanceof AsyncEmailSender); }