PageImpl extends ResourceImpl<ResourceContent> implements Page { public Pagelet[] getPagelets() { List<Pagelet> result = new ArrayList<Pagelet>(); for (List<Pagelet> pagelets : composers.values()) { result.addAll(pagelets); } return result.toArray(new Pagelet[result.size()]); } PageImpl(ResourceURI uri); @Override boolean supportsContentLanguage(Language language); String getLayout(); void setLayout(String layout); String getTemplate(); void setTemplate(String template); void setStationary(boolean stationary); boolean isStationary(); Composer getComposer(String composerId); Composer getStage(); Composer[] getComposers(); Pagelet addPagelet(Pagelet pagelet, String composer); Pagelet addPagelet(Pagelet pagelet, String composer, int position); Pagelet[] getPagelets(); Pagelet[] getPagelets(String composer); Pagelet[] getPagelets(String composer, String module, String id); Pagelet removePagelet(String composer, int position); Pagelet[] getPreview(); void addPageContentListener(PageContentListener listener); void removePageContentListener(PageContentListener listener);  }
@Test public void testGetPageletsString() { assertEquals(0, page.getPagelets("xxx").length); assertEquals(1, page.getPagelets(composer).length); }
@Test public void testGetPageletsStringStringString() { assertEquals(1, page.getPagelets(composer, "text", "title").length); assertEquals(0, page.getPagelets("xxx", "text", "title").length); assertEquals(0, page.getPagelets(composer, "text", "xxx").length); }