SessionApplicationStatePersistenceStrategy implements ApplicationStatePersistenceStrategy { @SuppressWarnings("unchecked") public <T> T get(Class<T> ssoClass, ApplicationStateCreator<T> creator) { return (T) getOrCreate(ssoClass, creator); } SessionApplicationStatePersistenceStrategy(Request request); @SuppressWarnings("unchecked") T get(Class<T> ssoClass, ApplicationStateCreator<T> creator); T getIfExists(Class<T> ssoClass); void set(Class<T> ssoClass, T sso); boolean exists(Class<T> ssoClass);  }
@SuppressWarnings("unchecked") @Test public void get_aso_already_exists() { Request request = mockRequest(); Session session = mockSession(); Class asoClass = ReadOnlyBean.class; Object aso = new ReadOnlyBean(); String key = "sso:" + asoClass.getName(); ApplicationStateCreator creator = mockApplicationStateCreator(); train_getSession(request, true, session); train_getAttribute(session, key, aso); replay(); ApplicationStatePersistenceStrategy strategy = new SessionApplicationStatePersistenceStrategy(request); assertSame(strategy.get(asoClass, creator), aso); verify(); }