NotificationManager { @VisibleForTesting protected List<Subscriber<AlertEntity>> subscribers() { return subscribers; }  @PostConstruct void start(); void addAlert(String dc, String cluster, String shard, HostPort hostPort, ALERT_TYPE type, String message);  }
@Test public void testSubscribers() { List<Subscriber<AlertEntity>> subscribers = notificationManager.subscribers(); Set<Class> subscriberList = Sets.newHashSet(AlertEntityImmediateSubscriber.class, AlertRecoverySubscriber.class, RepeatAlertEntitySubscriber.class); Assert.assertEquals(subscriberList.size(), subscribers.size()); subscribers.forEach(subscriber -> Assert.assertTrue(subscriberList.contains(subscriber.getClass()))); }