CompositeRestrictionProvider implements RestrictionProvider { public static RestrictionProvider newInstance(@NotNull RestrictionProvider... providers) { return newInstance(Arrays.asList(providers)); } private  CompositeRestrictionProvider(@NotNull Collection<? extends RestrictionProvider> providers); static RestrictionProvider newInstance(@NotNull RestrictionProvider... providers); static RestrictionProvider newInstance(@NotNull Collection<? extends RestrictionProvider> providers); @NotNull @Override Set<RestrictionDefinition> getSupportedRestrictions(@Nullable String oakPath); @NotNull @Override Restriction createRestriction(@Nullable String oakPath, @NotNull String oakName, @NotNull Value value); @NotNull @Override Restriction createRestriction(@Nullable String oakPath, @NotNull String oakName, @NotNull Value... values); @NotNull @Override Set<Restriction> readRestrictions(@Nullable String oakPath, @NotNull Tree aceTree); @Override void writeRestrictions(String oakPath, Tree aceTree, Set<Restriction> restrictions); @Override void validateRestrictions(@Nullable String oakPath, @NotNull Tree aceTree); @NotNull @Override RestrictionPattern getPattern(@Nullable String oakPath, @NotNull Tree tree); @NotNull @Override RestrictionPattern getPattern(@Nullable String oakPath, @NotNull Set<Restriction> restrictions);  }
@Test public void testEmpty() { assertSame(RestrictionProvider.EMPTY, CompositeRestrictionProvider.newInstance(Collections.<RestrictionProvider>emptySet())); }
@Test public void testSingle() { assertSame(rp1, CompositeRestrictionProvider.newInstance(Collections.singleton(rp1))); }
@Test public void testNewInstance() { RestrictionProvider crp = CompositeRestrictionProvider.newInstance(ImmutableSet.of(rp1, rp2)); RestrictionProvider crp2 = CompositeRestrictionProvider.newInstance(rp1, rp2); assertEquals(crp.getSupportedRestrictions("/testPath"), crp2.getSupportedRestrictions("/testPath")); }