@Test(dataProvider = "whenNotYetMarkedAsModifiedData") public void shouldReturnCorrectModifiedTimeEvenWhenNotYetMarkedAsModified(int secondsToAdvance) { Time.startSimulating(); NthLastModifiedTimeTracker tracker = new NthLastModifiedTimeTracker(ANY_NUM_TIMES_TO_TRACK); advanceSimulatedTimeBy(secondsToAdvance); int seconds = tracker.secondsSinceOldestModification(); assertThat(seconds).isEqualTo(secondsToAdvance); Time.stopSimulating(); }
public int secondsSinceOldestModification() { long modifiedTimeMillis = ((Long) lastModifiedTimesMillis.get()).longValue(); return (int) ((now() - modifiedTimeMillis) / MILLIS_IN_SEC); }
NthLastModifiedTimeTracker { public int secondsSinceOldestModification() { long modifiedTimeMillis = ((Long) lastModifiedTimesMillis.get()).longValue(); return (int) ((now() - modifiedTimeMillis) / MILLIS_IN_SEC); } }
NthLastModifiedTimeTracker { public int secondsSinceOldestModification() { long modifiedTimeMillis = ((Long) lastModifiedTimesMillis.get()).longValue(); return (int) ((now() - modifiedTimeMillis) / MILLIS_IN_SEC); } NthLastModifiedTimeTracker(int numTimesToTrack); }
NthLastModifiedTimeTracker { public int secondsSinceOldestModification() { long modifiedTimeMillis = ((Long) lastModifiedTimesMillis.get()).longValue(); return (int) ((now() - modifiedTimeMillis) / MILLIS_IN_SEC); } NthLastModifiedTimeTracker(int numTimesToTrack); int secondsSinceOldestModification(); void markAsModified(); }
NthLastModifiedTimeTracker { public int secondsSinceOldestModification() { long modifiedTimeMillis = ((Long) lastModifiedTimesMillis.get()).longValue(); return (int) ((now() - modifiedTimeMillis) / MILLIS_IN_SEC); } NthLastModifiedTimeTracker(int numTimesToTrack); int secondsSinceOldestModification(); void markAsModified();  }