BackendManagerImpl implements BackendManager { @Override public Collection<ConfigurationFolder> getFolders(final RootNode rootNode) { return configurationManager.getNodes(rootNode).stream() .map(new ConfigurationNodeFactory()).collect(toList()); } @Inject  BackendManagerImpl(final ConfigurationManager configurationManager, final EventBus eventBus); @Override Collection<ConfigurationFolder> getFolders(final RootNode rootNode); @Override ConfigurationFolder getFolder(final String id, final RootNode rootNode); @Override void addFolder(final ConfigurationFolder folder, final RootNode rootNode); @Override void editFolder(final String id, final ConfigurationFolder folder, final RootNode rootNode); @Override void removeFolder(final String id, final RootNode rootNode); @Override Settings getSettings(); @Override void saveSettings(final Settings settings);  }
@Test public void testGetFolders() { ConfigurationManager configurationManager = createMock(ConfigurationManager.class); EventBus eventBus = createMock(EventBus.class); expect(configurationManager.getNodes(AUDIO)).andReturn(newArrayList(new ConfigurationNode("id", "name", "path"))); replay(configurationManager, eventBus); BackendManagerImpl backendManager = new BackendManagerImpl(configurationManager, eventBus); Collection<ConfigurationFolder> folders = backendManager.getFolders(AUDIO); assertNotNull(folders); assertEquals(1, folders.size()); verify(configurationManager, eventBus); }