ListeningViewAutoStartManager implements ViewAutoStartManager { @Override public Map<String, AutoStartViewDefinition> getAutoStartViews() { if (!_isInitialized) { throw new IllegalStateException("Manager has not been initialized, cannot access data"); } ImmutableMap.Builder<String, AutoStartViewDefinition> builder = ImmutableMap.builder(); for (Pair<String, AutoStartViewDefinition> pair : _autoStartViews.values()) { builder.put(pair.getFirst(), pair.getSecond()); } return builder.build(); } ListeningViewAutoStartManager(ConfigSource configSource); @Override void initialize(); @Override Map<String, AutoStartViewDefinition> getAutoStartViews();  }
@Test(expectedExceptions = IllegalStateException.class) public void testCannotGetViewsUntilStarted() { ViewAutoStartManager manager = new ListeningViewAutoStartManager(createConfigSource(1)); manager.getAutoStartViews(); }