}
@Override
public KeyValue<T> next() {
byte[][] keyAndVal = cursor.get(false);
hasNext = cursor.step();
if (!hasNext) {
close();
}
return new KeyValue<>(SerializationUtils.bytesToLong(keyAndVal[0]), SerializationUtils.bytesToObject(keyAndVal[1], getObjectClass()));
}