@Test
public void getSessionByIdentifier() {
Batcher<Batch> batcher = mock(Batcher.class);
Batch batch = mock(Batch.class);
ImmutableSession session = mock(ImmutableSession.class);
ImmutableSessionAttributes attributes = mock(ImmutableSessionAttributes.class);
ImmutableSessionMetaData metaData = mock(ImmutableSessionMetaData.class);
String id = "session";
String name = "name";
Object value = new Object();
Set<String> names = Collections.singleton(name);
Date creationTime = new Date();
Date lastAccessedTime = new Date();
long maxInactiveInterval = 30;
when(this.manager.getBatcher()).thenReturn(batcher);
when(this.manager.viewSession(id)).thenReturn(session);
when(session.getId()).thenReturn(id);
when(session.getAttributes()).thenReturn(attributes);
when(attributes.getAttributeNames()).thenReturn(names);
when(attributes.getAttribute(name)).thenReturn(value);
when(session.getMetaData()).thenReturn(metaData);
when(metaData.getCreationTime()).thenReturn(creationTime);
when(metaData.getLastAccessedTime()).thenReturn(lastAccessedTime);
when(metaData.getMaxInactiveInterval(TimeUnit.SECONDS)).thenReturn(maxInactiveInterval);
when(batcher.createBatch()).thenReturn(batch);