MonitorableRegistry { public synchronized Collection<Monitorable<?>> getMonitorables() { return ImmutableList.copyOf(monitorables.values()); }  synchronized void register(Monitorable<T> monitorable); @SuppressWarnings("unchecked") synchronized T registerOrReuse(Monitorable<T> monitorable); synchronized Collection<Monitorable<?>> getMonitorables(); static void clearDefaultRegistry(); static MonitorableRegistry getNamedInstance(String name); void addRegistryListener(MonitorableRegistryListener monitorableRegistryListener); void removeRegistryListener(MonitorableRegistryListener listener); static MonitorableRegistry DEFAULT_REGISTRY; }
@Test public void getMonitorablesOnNewRegistryReturnsEmptyCollection() { MonitorableRegistry registry = newRegistry(); assertTrue(registry.getMonitorables().isEmpty()); }