@Override
public Cursor findFirstOrLast(ServerSession session, boolean first) {
TransactionMap<Value, VersionedValue> map = getMap(session);
ValueLong v = (ValueLong) (first ? map.firstKey() : map.lastKey());
if (v == null) {
return new StandardPrimaryIndexCursor(session, table, this,
Collections.<Entry<Value, VersionedValue>> emptyList().iterator(), null);
}
VersionedValue value = map.get(v);
Entry<Value, VersionedValue> e = new DataUtils.MapEntry<Value, VersionedValue>(v, value);
List<Entry<Value, VersionedValue>> list = Arrays.asList(e);
StandardPrimaryIndexCursor c = new StandardPrimaryIndexCursor(session, table, this, list.iterator(), v);
c.next();
return c;
}