GenericTreeStructure implements TreeStructure { public ProjectNode newProjectNode(@NotNull ProjectDescriptor data) { return getNodeFactory().newProjectNode(null, data, this); } protected  GenericTreeStructure(NodeFactory nodeFactory, EventBus eventBus, AppContext appContext,
                                   ProjectServiceClient projectServiceClient, DtoUnmarshallerFactory dtoUnmarshallerFactory); @Override void getRootNodes(@NotNull AsyncCallback<List<TreeNode<?>>> callback); @NotNull @Override TreeSettings getSettings(); NodeFactory getNodeFactory(); @Override void getNodeByPath(@NotNull final String path, @NotNull final AsyncCallback<TreeNode<?>> callback); ProjectNode newProjectNode(@NotNull ProjectDescriptor data); FileNode newFileNode(@NotNull TreeNode parent, @NotNull ItemReference data); FolderNode newFolderNode(@NotNull TreeNode parent, @NotNull ItemReference data);  }
@Test public void testNewProjectNode() throws Exception { ProjectDescriptor data = mock(ProjectDescriptor.class); treeStructure.newProjectNode(data); verify(nodeFactory).newProjectNode(isNull(TreeNode.class), eq(data), eq(treeStructure)); }
@Test public void newProjectNodeShouldBeReturned() { assertThat(treeStructure.newProjectNode(projectDescriptor), is(projectNode)); verify(nodeFactory).newProjectNode(null, projectDescriptor, treeStructure); }