PermissionEntryProviderImpl implements PermissionEntryProvider { private void init() { if (!initialized) { PermissionCacheBuilder builder = new PermissionCacheBuilder(store); noExistingNames = builder.init(principalNames, new CacheStrategyImpl(options, isRefreshed)); permissionCache = builder.build(); initialized = true; } } PermissionEntryProviderImpl(@NotNull PermissionStore store, @NotNull Set<String> principalNames, @NotNull ConfigurationParameters options); @Override void flush(); @Override @NotNull Iterator<PermissionEntry> getEntryIterator(@NotNull EntryPredicate predicate); @Override @NotNull Collection<PermissionEntry> getEntries(@NotNull Tree accessControlledTree);  }
@Test public void testInit() throws Exception { MockPermissionStore store = new MockPermissionStore(); Set<String> principalNames = Sets.newHashSet("noEntries", "noEntries2", "noEntries3"); PermissionEntryProviderImpl provider = new PermissionEntryProviderImpl(store, principalNames, ConfigurationParameters.EMPTY); assertFalse(getBooleanField(provider, "initialized")); provider.getEntryIterator(EntryPredicate.create()); assertTrue(getBooleanField(provider, "initialized")); provider.flush(); assertFalse(getBooleanField(provider, "initialized")); provider.getEntries(mock(Tree.class)); assertTrue(getBooleanField(provider, "initialized")); }