@Test public void getRootReturnsManagerWhenNodeIsNoRoot() { var managerNode = new HierarchyTreeNode(otherUserMock); var node = new HierarchyTreeNode(userMock); node.manager = managerNode; assertThat(node.getRoot()).isSameAs(managerNode); }
public HierarchyTreeNode getRoot() { if(isRoot()) { return this; } return manager.getRoot(); }
HierarchyTreeNode implements Iterable<HierarchyTreeNode>, Streamable<HierarchyTreeNode>, Serializable { public HierarchyTreeNode getRoot() { if(isRoot()) { return this; } return manager.getRoot(); } }
HierarchyTreeNode implements Iterable<HierarchyTreeNode>, Streamable<HierarchyTreeNode>, Serializable { public HierarchyTreeNode getRoot() { if(isRoot()) { return this; } return manager.getRoot(); } HierarchyTreeNode(User user); }
HierarchyTreeNode implements Iterable<HierarchyTreeNode>, Streamable<HierarchyTreeNode>, Serializable { public HierarchyTreeNode getRoot() { if(isRoot()) { return this; } return manager.getRoot(); } HierarchyTreeNode(User user); boolean isLeaf(); boolean isRoot(); HierarchyTreeNode getRoot(); void addDirectStaffMember(HierarchyTreeNode staffNode); void removeDirectStaffMember(HierarchyTreeNode staffNode); @Override Iterator<HierarchyTreeNode> iterator(); @Override boolean equals(Object obj); @Override int hashCode(); }
HierarchyTreeNode implements Iterable<HierarchyTreeNode>, Streamable<HierarchyTreeNode>, Serializable { public HierarchyTreeNode getRoot() { if(isRoot()) { return this; } return manager.getRoot(); } HierarchyTreeNode(User user); boolean isLeaf(); boolean isRoot(); HierarchyTreeNode getRoot(); void addDirectStaffMember(HierarchyTreeNode staffNode); void removeDirectStaffMember(HierarchyTreeNode staffNode); @Override Iterator<HierarchyTreeNode> iterator(); @Override boolean equals(Object obj); @Override int hashCode();  }