public Segment next( WorkspaceCache cache ) {
if (next == null && nextKey != null) {
Document blockDoc = cache.blockFor(nextKey);
if (blockDoc == null) {
throw new DocumentNotFoundException(nextKey);
}
// we only need the direct children of the block to avoid nesting
ChildReferences refs = cache.translator().getChildReferencesFromBlock(blockDoc);
ChildReferencesInfo nextNextKey = cache.translator().getChildReferencesInfo(blockDoc);
next = new Segment(refs, nextNextKey != null ? nextNextKey.nextKey : null);