@Test
public void giveUserAccessUntilDoesNotUpdateAccessWhenOldEndEqualsNewEnd() {

    var expectedStartTime = LocalDateTime.now(clock).minus(1L, ChronoUnit.DAYS);
    var initialEndTime = LocalDateTime.now(clock).plus(10L, ChronoUnit.MINUTES);
    given(userMock.getLatestAccessInterval()).willReturn(Optional.of(accessIntervalMock));
    given(accessIntervalMock.getStartTime()).willReturn(expectedStartTime);
    given(accessIntervalMock.getEndTime()).willReturn(initialEndTime);
    // when
    var actualUser = accessService.giveUserAccessUntil(userMock, initialEndTime);
    // then
    assertThat(actualUser).isEqualTo(userMock);
    verify(accessIntervalMock, never()).setEndTime(any(LocalDateTime.class));
    verifyZeroInteractions(intervalRepo);
    verifyZeroInteractions(userAccessEventHandlerMock);
}