Long lastProcessedIndex = new Long(sessionContext.getLastProcessedEventIndex());
if (list.containsKey(lastProcessedIndex)) {
startIndex = (Long) list.nextKey(lastProcessedIndex);
}
else {
startIndex = (Long) list.firstKey();
}
// Set start index as WebTML option
tag.getStatus().setOption(Base.OPTION_PORTLET_EVENT_STARTINDEX, new Long(sessionContext.getLastProcessedEventIndex()), null);