ApiFilteredNode extends ApiNode implements FilteredNode { public FilteredNode showHasEdit(User user) { return show(new PermissionFilter(user, false)); } @SuppressWarnings("unchecked")  ApiFilteredNode(NavigationImpl navigation, NodeContext<ApiNode> context); private  ApiFilteredNode(NavigationImpl navigation, NodeContext<ApiNode> context, FilteredNodeMap map); @Override Node addChild(int index, String childName); @Override Node addChild(String childName); @Override Node getChild(int index); @Override Node getChild(String childName); @Override int getChildCount(); @Override Node getNode(NodePath nodePath); @Override Node getParent(); @Override boolean hasChild(String childName); @Override int indexOf(String childName); @Override Iterator<Node> iterator(); @Override void moveTo(int index); @Override void moveTo(int index, Node parent); @Override @SuppressWarnings("unchecked") FilteredNode showAll(); @Override FilteredNode showDefault(); @Override FilteredNode showHasAccess(User user); FilteredNode showHasEdit(User user); @Override FilteredNode showVisible(); @Override FilteredNode show(Filter<Node> filter);  }
@Test public void showHasEdit() { createPage(defaultSiteId, "page1"); setPermission(new PageId(defaultSiteId, "page1"), "*:/platform/administrators", "Everyone"); createPage(defaultSiteId, "page2"); setPermission(new PageId(defaultSiteId, "page2"), "Everyone", "Everyone"); root.getChild("child1").setPageId(new PageId(defaultSiteId, "page1")); root.getChild("child2").setPageId(new PageId(defaultSiteId, "page2")); assertIterator(root.filter().showHasEdit(new User("a")).iterator(), "child0", "child2", "child3", "child4"); assertIterator(root.filter().showHasEdit(new User("root")).iterator(), "child0", "child1", "child2", "child3", "child4"); }