ApplicationStateManagerImpl implements ApplicationStateManager { public <T> void set(Class<T> ssoClass, T sso) { getAdapter(ssoClass).set(sso); } @SuppressWarnings("unchecked")  ApplicationStateManagerImpl(Map<Class, ApplicationStateContribution> configuration,
            ApplicationStatePersistenceStrategySource source, ObjectLocator locator); T get(Class<T> ssoClass); T getIfExists(Class<T> ssoClass); void set(Class<T> ssoClass, T sso); boolean exists(Class<T> ssoClass);  }
@SuppressWarnings("unchecked") @Test public void set_configured_aso() { String strategyName = "ethereal"; ApplicationStatePersistenceStrategy strategy = mockApplicationStatePersistenceStrategy(); ApplicationStatePersistenceStrategySource source = mockApplicationStatePersistenceStrategySource(); Class asoClass = ReadOnlyBean.class; Object aso = new ReadOnlyBean(); Map<Class, ApplicationStateContribution> configuration = Collections.singletonMap(asoClass, new ApplicationStateContribution(strategyName)); train_get(source, strategyName, strategy); strategy.set(asoClass, aso); replay(); ApplicationStateManager manager = new ApplicationStateManagerImpl(configuration, source, null); manager.set(asoClass, aso); verify(); }