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