@Test public void getNestedExtensionPages() { assertEquals(new HashSet<>(Arrays.asList(this.alice, this.bob)), this.tree.getNestedExtensionPages(this.alice.getWikiReference())); assertEquals(new HashSet<>(Arrays.asList(this.alice, this.bob)), this.tree.getNestedExtensionPages(this.path)); assertEquals(Collections.singleton(this.alice), this.tree.getNestedExtensionPages(this.to)); assertEquals(new HashSet<>(Arrays.asList(this.carol, this.denis, this.john)), this.tree.getNestedExtensionPages(this.carol.getWikiReference())); assertEquals(Collections.singleton(this.john), this.tree.getNestedExtensionPages(this.carol)); assertEquals(Collections.singleton(this.denis), this.tree.getNestedExtensionPages(this.users)); assertEquals(Collections.emptySet(), this.tree.getNestedExtensionPages(new WikiReference("test"))); assertEquals(Collections.emptySet(), this.tree.getNestedExtensionPages(this.bob)); assertEquals(Collections.emptySet(), this.tree.getNestedExtensionPages(this.path.getLastSpaceReference())); assertEquals(Collections.emptySet(), this.tree.getNestedExtensionPages(new DocumentReference("bar", "Path", "WebHome"))); assertEquals(Collections.emptySet(), this.tree.getNestedExtensionPages(new DocumentReference(this.path, Locale.FRENCH))); }
public Set<DocumentReference> getNestedExtensionPages(EntityReference rootReference) { Set<DocumentReference> documentReferences = new HashSet<>(); Queue<DocumentReference> queue = new LinkedList<>(getChildren(rootReference)); while (!queue.isEmpty()) { DocumentReference parentReference = queue.remove(); queue.addAll(getChildren(parentReference)); if (isExtensionPage(parentReference)) { documentReferences.add(parentReference); } } return documentReferences; }
InstalledExtensionDocumentTree { public Set<DocumentReference> getNestedExtensionPages(EntityReference rootReference) { Set<DocumentReference> documentReferences = new HashSet<>(); Queue<DocumentReference> queue = new LinkedList<>(getChildren(rootReference)); while (!queue.isEmpty()) { DocumentReference parentReference = queue.remove(); queue.addAll(getChildren(parentReference)); if (isExtensionPage(parentReference)) { documentReferences.add(parentReference); } } return documentReferences; } }
InstalledExtensionDocumentTree { public Set<DocumentReference> getNestedExtensionPages(EntityReference rootReference) { Set<DocumentReference> documentReferences = new HashSet<>(); Queue<DocumentReference> queue = new LinkedList<>(getChildren(rootReference)); while (!queue.isEmpty()) { DocumentReference parentReference = queue.remove(); queue.addAll(getChildren(parentReference)); if (isExtensionPage(parentReference)) { documentReferences.add(parentReference); } } return documentReferences; }  }
InstalledExtensionDocumentTree { public Set<DocumentReference> getNestedExtensionPages(EntityReference rootReference) { Set<DocumentReference> documentReferences = new HashSet<>(); Queue<DocumentReference> queue = new LinkedList<>(getChildren(rootReference)); while (!queue.isEmpty()) { DocumentReference parentReference = queue.remove(); queue.addAll(getChildren(parentReference)); if (isExtensionPage(parentReference)) { documentReferences.add(parentReference); } } return documentReferences; }  Set<DocumentReference> getChildren(EntityReference parentReference); boolean isExtensionPage(DocumentReference documentReference); boolean isCustomizedExtensionPage(DocumentReference documentReference); Set<DocumentReference> getNestedExtensionPages(EntityReference rootReference); Set<DocumentReference> getNestedCustomizedExtensionPages(EntityReference rootReference); }
InstalledExtensionDocumentTree { public Set<DocumentReference> getNestedExtensionPages(EntityReference rootReference) { Set<DocumentReference> documentReferences = new HashSet<>(); Queue<DocumentReference> queue = new LinkedList<>(getChildren(rootReference)); while (!queue.isEmpty()) { DocumentReference parentReference = queue.remove(); queue.addAll(getChildren(parentReference)); if (isExtensionPage(parentReference)) { documentReferences.add(parentReference); } } return documentReferences; }  Set<DocumentReference> getChildren(EntityReference parentReference); boolean isExtensionPage(DocumentReference documentReference); boolean isCustomizedExtensionPage(DocumentReference documentReference); Set<DocumentReference> getNestedExtensionPages(EntityReference rootReference); Set<DocumentReference> getNestedCustomizedExtensionPages(EntityReference rootReference);  }