assertThat("replacement id", pool.save(session), equalTo("2"));
}
@Test public void
savesSessionContentDefensively() {
Session data = new Session();
data.put("a", "Alice");
data.put("b", "Bob");
data.put("c", "Chris");
data.maxAge(maxAge);
Session saved = save(data);
data.clear();
assertThat("saved session", saved, not(Matchers.sameInstance(data)));
assertThat("saved session expiration time", saved.maxAge(), equalTo(maxAge));
assertThat("saved session keys", saved.keys(), Matchers.<Object>contains("a", "b", "c"));
assertThat("saved session values", saved.values(), Matchers.<Object>contains("Alice", "Bob", "Chris"));
}