List<Session> sessionList = new ArrayList<Session>();
for (int i = 0; i < 100; i++) {
sessionList.add(new MockSession(i));
}
Collections.sort(sessionList, new MemcachedSessionComparator());
for (int i = 0; i < sessionList.size(); i++) {
if (i < sessionList.size() - 1) {
int next = i + 1;
MockSession nextSession = (MockSession) sessionList.get(next);