ExperimentalActivitiesAuthorizationManagerImpl implements ExperimentalActivitiesAuthorizationManager { @Override public boolean authorizeActivity(Object activity) { return authorizeActivityClass(activity.getClass()); } @Inject  ExperimentalActivitiesAuthorizationManagerImpl(SyncBeanManager iocManager, ClientExperimentalFeaturesRegistryService experimentalFeaturesRegistryService, Event<PerspectiveVisibiltiyChangeEvent> perspectiveVisibleEvent);   ExperimentalActivitiesAuthorizationManagerImpl(SyncBeanManager iocManager, ClientExperimentalFeaturesRegistryService experimentalFeaturesRegistryService, Event<PerspectiveVisibiltiyChangeEvent> perspectiveVisibleEvent, Supplier<String> uniqueIdSupplier); void init(); @Override boolean authorizeActivity(Object activity); @Override boolean authorizeActivityClass(Class activityClass); @Override void securePart(PartDefinition part, PanelDefinition panel); @Override boolean authorizeActivityId(final String activityId); void onFeatureModified(@Observes PortableExperimentalFeatureModifiedEvent event); void onFeatureModified(@Observes NonPortableExperimentalFeatureModifiedEvent event);  }
@Test public void testAuthorizeActivities() { assertTrue(authorizationManager.authorizeActivity(new TestExperimentalScreen1Activity(placeManager))); verify(registryService).isFeatureEnabled(FEATURE_1_ID); assertFalse(authorizationManager.authorizeActivity(new TestExperimentalScreen2Activity(placeManager))); verify(registryService).isFeatureEnabled(FEATURE_2_ID); assertTrue(authorizationManager.authorizeActivity(new TestNonExperimentalScreenActivity(placeManager))); verify(registryService, times(2)).isFeatureEnabled(anyString()); }