### Question:
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }   final InteractorSubject<Timeline> timeline; }### Answer:
@Test public void getValidTimeline() throws Exception { final Timeline validTimeline = new TimelineBuilder().setScore(1, ScoreCondition.IDEAL).build(); final Timeline result = lastNightInteractor.getValidTimeline(validTimeline); assertThat(result, equalTo(validTimeline)); }
@Test public void update() throws Exception { final LastNightInteractor lastNightInteractorSpy = spy(lastNightInteractor); final Timeline result = Sync.wrapAfter(lastNightInteractorSpy::update, lastNightInteractorSpy.timeline) .last(); verify(lastNightInteractorSpy).getValidTimeline(any(Timeline.class)); }