class UserUpdater {

    HierarchyTreeNode buildHierarchyNode(@NonNull LdapUserNode rootNode, @NonNull List<LdapUserNode> childNodes) {
        var rootNodeUser = repoUserService.getOrCreateUserById(rootNode.getId());
        var rootHierarchyNode = new HierarchyTreeNode(rootNodeUser);

        var dnHierarchyNodeMap = new HashMap<String, HierarchyTreeNode>();
        dnHierarchyNodeMap.put(rootNode.getDn(), rootHierarchyNode);

        childNodes.forEach(childNode -> {
            var userId = childNode.getId();
            var user = repoUserService.getOrCreateUserById(userId);
            var childHierarchyNode = new HierarchyTreeNode(user);

            dnHierarchyNodeMap.put(childNode.getDn(), childHierarchyNode);

            var managerHierarchy = dnHierarchyNodeMap.get(childNode.getManagerDn());
            if(Objects.isNull(managerHierarchy)) {
                throw new IllegalArgumentException("Child nodes not in level order!");
            }
            managerHierarchy.addDirectStaffMember(childHierarchyNode);
        });

        return rootHierarchyNode;
    }

    public  UserUpdater(HierarchyTreeNodeRepository hierarchyTreeNodeRepo,
                       RepositoryUserService repoUserService,
                       UserDataRepository userDataRepo,
                       LdapAdapter ldapAdapter,
                       List<Normalizer<UserData>> normalizers);

}