@Test
public void threadLocalsAfterUnderlyingSessionTimeout()
throws InterruptedException {
final AtomicBoolean detachCalled = new AtomicBoolean(false);
ui.addDetachListener(new DetachListener() {
@Override
public void detach(DetachEvent event) {
detachCalled.set(true);
Assert.assertEquals(ui, UI.getCurrent());
Assert.assertEquals(ui.getPage(), Page.getCurrent());