* @throws NodeNotFoundInParentException if the node doesn't exist in the referenced parent
*/
protected final Segment getSegment( NodeCache cache,
CachedNode parent ) {
if (parent != null) {
ChildReference ref = parent.getChildReferences(cache).getChild(key, new BasicContext());
if (ref == null) {
// This node doesn't exist in the parent
throw new NodeNotFoundInParentException(key, parent.getKey());
}
return ref.getSegment();