@Test public void givenFirstVisibleIsHalfFullscreenTimeout_whenIShouldDisplayFullscreen_thenIExpectFalse() { long now = System.currentTimeMillis(); long lastWeek = now - TimeUnit.DAYS.toMillis(PinsForAllSchedule.DAYS_UNTIL_FULLSCREEN / 2); boolean result = PinsForAllSchedule.shouldDisplayFullScreen(lastWeek, now); assertFalse(result); }
static boolean shouldDisplayFullScreen(long firstVisible, long currentTime) { if (firstVisible == 0L) { return false; } return currentTime - firstVisible >= TimeUnit.DAYS.toMillis(DAYS_UNTIL_FULLSCREEN); }
PinsForAllSchedule implements MegaphoneSchedule { static boolean shouldDisplayFullScreen(long firstVisible, long currentTime) { if (firstVisible == 0L) { return false; } return currentTime - firstVisible >= TimeUnit.DAYS.toMillis(DAYS_UNTIL_FULLSCREEN); } }
PinsForAllSchedule implements MegaphoneSchedule { static boolean shouldDisplayFullScreen(long firstVisible, long currentTime) { if (firstVisible == 0L) { return false; } return currentTime - firstVisible >= TimeUnit.DAYS.toMillis(DAYS_UNTIL_FULLSCREEN); }  }
PinsForAllSchedule implements MegaphoneSchedule { static boolean shouldDisplayFullScreen(long firstVisible, long currentTime) { if (firstVisible == 0L) { return false; } return currentTime - firstVisible >= TimeUnit.DAYS.toMillis(DAYS_UNTIL_FULLSCREEN); }  @Override boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime); }
PinsForAllSchedule implements MegaphoneSchedule { static boolean shouldDisplayFullScreen(long firstVisible, long currentTime) { if (firstVisible == 0L) { return false; } return currentTime - firstVisible >= TimeUnit.DAYS.toMillis(DAYS_UNTIL_FULLSCREEN); }  @Override boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime);  }