### Question:
MaximumTotalTime implements TerminationCondition { @Override public void assertContinue() throws StoreCopyFailedException { if ( clock.millis() > endTime ) { throw new StoreCopyFailedException( format( "Maximum time passed %d %s. Not allowed to continue", time, timeUnit ) ); } } MaximumTotalTime( long time, TimeUnit timeUnit );   MaximumTotalTime( long time, TimeUnit timeUnit, Clock clock ); @Override void assertContinue();  }### Answer:
@Test public void shouldFailWhenAllowedTimeHasPassed() throws StoreCopyFailedException { TimeUnit timeUnit = TimeUnit.SECONDS; FakeClock fakeClock = new FakeClock( 0, timeUnit ); MaximumTotalTime maximumTotalTime = new MaximumTotalTime( 5, timeUnit, fakeClock ); maximumTotalTime.assertContinue(); fakeClock.forward( 5, timeUnit ); maximumTotalTime.assertContinue(); expectedException.expect( StoreCopyFailedException.class ); fakeClock.forward( 1, timeUnit ); maximumTotalTime.assertContinue(); }