class RepositoryUserService implements UserService {

    @Override
    public User getManagerOfUser(@NonNull User user) {
        var hierarchy = getHierarchyForUser(user);
        if(hierarchy.isRoot()) {
            return hierarchy.getUser();
        }

        return hierarchy
                .getManager()
                .getUser();
    }

    public  RepositoryUserService(UserRepository userRepo,
                                 UserDataRepository dataRepo,
                                 LdapAdapter ldapAdapter,
                                 HierarchyTreeNodeRepository hierarchyTreeNodeRepo,
                                 HibernateSearchService hibernateSearchService);

}