public void shouldCreateFilteringSequenceThatIncludesOnlyNonSystemNodes() {
RowFilter nonSysFilter = rowFilterOfNodesWithKeysHavingWorkspaceKey(0, NodeKey.keyForWorkspaceName(workspaceName()));
NodeSequence seq = NodeSequence.filter(allNodes(), nonSysFilter);
try {
// Iterate over the batches ...
Batch batch = null;
while ((batch = seq.nextBatch()) != null) {
while (batch.hasNext()) {
batch.nextRow();
CachedNode node = batch.getNode();
if (node != null) {
Path path = node.getPath(cache);
boolean isSystem = path.getSegment(0).getName().equals(JcrLexicon.SYSTEM);
assertTrue(path.isRoot() || !isSystem);
}