DataProviderCache { public void saveSessions(List<Session> sessions) { this.sessions = sessions; sessionsFetchedTime = LocalDateTime.now(); }  List<Session> getSessions(); void saveSessions(List<Session> sessions); List<Speaker> getSpeakers(); void saveSpeakers(List<Speaker> speakers);  }
@Test public void should_save_sessions_in_memory_keeping_save_time() { LocalDateTime before = LocalDateTime.now(); cache.saveSessions(sessions); LocalDateTime after = LocalDateTime.now(); assertThat(cache.sessions).hasSize(2); assertThat(cache.sessionsFetchedTime).isAtLeast(before); assertThat(cache.sessionsFetchedTime).isAtMost(after); }