@Test
public void usersAreManagersThrowsExceptionWhenNoHierarchyPresentForSomeUser() {

    // given
    var expectedMessage = "Hierarchy for some users not present!";
    var users = Set.of(userMock, otherUserMock);
    var hierarchies = List.of(hierarchyTreeNodeMock);
    given(hierarchyTreeNodeMock.getUser()).willReturn(userMock);
    given(hierarchyTreeNodeMock.isManagingUser()).willReturn(true);
    given(hierarchyTreeNodeRepoMock.findByUserIn(users)).willReturn(hierarchies);
    // when / then
    assertThatThrownBy(() -> repoUserService.usersAreManagers(users))
            .isInstanceOf(IllegalStateException.class)
            .hasMessage(expectedMessage);
}