@Test
public void addAccessIntervalAddsIntervalWhenItBelongsToUser() {

    // given
    User user = new User("user");
    given(accessIntervalMock.getUser()).willReturn(user);
    // when
    user.addAccessInterval(accessIntervalMock);
    // then
    assertThat(user.accessIntervals).containsExactly(accessIntervalMock);
}