Source:
<code>public ChildReferences getChildReferences( WorkspaceCache cache, Document document ) { Name primaryType = getPrimaryType(document); NodeTypes nodeTypes = getNodeTypes(cache); boolean isUnorderedCollection = nodeTypes != null && nodeTypes.isUnorderedCollection(primaryType); boolean hasChildren = document.containsField(CHILDREN); boolean hasFederatedSegments = document.containsField(FEDERATED_SEGMENTS); if (!hasChildren && !hasFederatedSegments && !isUnorderedCollection) { return ImmutableChildReferences.EMPTY_CHILD_REFERENCES; } if (isUnorderedCollection) { <START> return document.containsField(PRB) ? new BucketedChildReferences(document, this) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; <END> } Set<Name> mixinTypes = getMixinTypes(document); boolean allowsSNS = nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); ChildReferences internalChildRefs = hasChildren ? ImmutableChildReferences.create(this, document, CHILDREN, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferences externalChildRefs = hasFederatedSegments ? ImmutableChildReferences.create(this, document, FEDERATED_SEGMENTS, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferencesInfo info = getChildReferencesInfo(document); if (!hasChildren) { return ImmutableChildReferences.create(externalChildRefs, info, cache, allowsSNS); } else if (!hasFederatedSegments) { return ImmutableChildReferences.create(internalChildRefs, info, cache, allowsSNS); } else { return ImmutableChildReferences.create(internalChildRefs, info, externalChildRefs, cache, allowsSNS); } }</code><technical_language>is for EmptyCollection returned is in fact empty?!</technical_language>

Target:
public ChildReferences getChildReferences( WorkspaceCache cache, Document document ) { Name primaryType = getPrimaryType(document); Set<Name> mixinTypes = getMixinTypes(document); NodeTypes nodeTypes = getNodeTypes(cache); boolean isUnorderedCollection = nodeTypes != null && nodeTypes.isUnorderedCollection(primaryType, mixinTypes); if (isUnorderedCollection) { return new BucketedChildReferences(document, this); } boolean hasChildren = document.containsField(CHILDREN); boolean hasFederatedSegments = document.containsField(FEDERATED_SEGMENTS); if (!hasChildren && !hasFederatedSegments) { return ImmutableChildReferences.EMPTY_CHILD_REFERENCES; } boolean allowsSNS = nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); ChildReferences internalChildRefs = hasChildren ? ImmutableChildReferences.create(this, document, CHILDREN, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferences externalChildRefs = hasFederatedSegments ? ImmutableChildReferences.create(this, document, FEDERATED_SEGMENTS, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferencesInfo info = getChildReferencesInfo(document); if (!hasChildren) { return ImmutableChildReferences.create(externalChildRefs, info, cache, allowsSNS); } else if (!hasFederatedSegments) { return ImmutableChildReferences.create(internalChildRefs, info, cache, allowsSNS); } else { return ImmutableChildReferences.create(internalChildRefs, info, externalChildRefs, cache, allowsSNS); } }