CompositeConfiguration implements SecurityConfiguration { @NotNull @Override public List<ThreeWayConflictHandler> getConflictHandlers() { return ImmutableList.copyOf(Iterables.concat(Lists.transform(getConfigurations(), securityConfiguration -> securityConfiguration.getConflictHandlers()))); } CompositeConfiguration(@NotNull String name);  CompositeConfiguration(@NotNull String name, @NotNull SecurityProvider securityProvider); @Nullable T getDefaultConfig(); void setDefaultConfig(@NotNull T defaultConfig); void addConfiguration(@NotNull T configuration); void addConfiguration(@NotNull T configuration, @NotNull ConfigurationParameters params); void removeConfiguration(@NotNull T configuration); @NotNull List<T> getConfigurations(); void setSecurityProvider(@NotNull SecurityProvider securityProvider); void setRootProvider(@NotNull RootProvider rootProvider); void setTreeProvider(@NotNull TreeProvider treeProvider); @NotNull @Override String getName(); @NotNull @Override ConfigurationParameters getParameters(); @NotNull @Override WorkspaceInitializer getWorkspaceInitializer(); @NotNull @Override RepositoryInitializer getRepositoryInitializer(); @NotNull @Override List<? extends CommitHook> getCommitHooks(@NotNull final String workspaceName); @NotNull @Override List<? extends ValidatorProvider> getValidators(@NotNull final String workspaceName, @NotNull final Set<Principal> principals, @NotNull final MoveTracker moveTracker); @NotNull @Override List<ThreeWayConflictHandler> getConflictHandlers(); @NotNull @Override List<ProtectedItemImporter> getProtectedItemImporters(); @NotNull @Override Context getContext(); static final String PARAM_RANKING; }
@Test public void testGetConflictHandlers() { assertTrue(compositeConfiguration.getConflictHandlers().isEmpty()); addConfiguration(new SecurityConfiguration.Default()); assertTrue(compositeConfiguration.getConflictHandlers().isEmpty()); SecurityConfiguration withConflictHandler = new SecurityConfiguration.Default() { @NotNull @Override public List<ThreeWayConflictHandler> getConflictHandlers() { return ImmutableList.of(Mockito.mock(ThreeWayConflictHandler.class)); } }; addConfiguration(withConflictHandler); assertEquals(1, compositeConfiguration.getConflictHandlers().size()); }