ElapsedTimeRolloverCondition implements RolloverCondition { @Override public boolean isRolloverReady(PacketBuffer packetBuffer) { notNull(packetBuffer, "packetBuffer must be non-null"); return packetBuffer.getAge() >= elapsedTimeThreshold; } ElapsedTimeRolloverCondition(long elapsedTimeThreshold); long getElapsedTimeThreshold(); void setElapsedTimeThreshold(long elapsedTimeThreshold); @Override boolean isRolloverReady(PacketBuffer packetBuffer); @Override void accept(Visitor visitor); @Override String toString();  }
@Test public void testLessThanThreshold() { when(packetBuffer.getAge()).thenReturn(THRESHOLD - 1); assertThat(elapsedTimeRolloverCondition.isRolloverReady(packetBuffer), is(false)); }
@Test public void testEqualToThreshold() { when(packetBuffer.getAge()).thenReturn(THRESHOLD); assertThat(elapsedTimeRolloverCondition.isRolloverReady(packetBuffer), is(true)); }
@Test public void testGreaterThanThreshold() { when(packetBuffer.getAge()).thenReturn(THRESHOLD + 1); assertThat(elapsedTimeRolloverCondition.isRolloverReady(packetBuffer), is(true)); }