String value = "testValue";
DefaultSecurityManager sm = new DefaultSecurityManager();
DelegatingSubject subject = new DelegatingSubject(sm);
Session session = subject.getSession();
session.setAttribute(key, value);
assertTrue(session.getAttribute(key).equals(value));
Serializable firstSessionId = session.getId();
assertNotNull(firstSessionId);
session.stop();
session = subject.getSession();
assertNotNull(session);
assertNull(session.getAttribute(key));
Serializable secondSessionId = session.getId();
assertNotNull(secondSessionId);
assertFalse(firstSessionId.equals(secondSessionId));
subject.logout();