### Question:
CatchupGoal { boolean achieved( FollowerState followerState ) { if ( followerState.getMatchIndex() >= targetIndex ) { if ( (clock.millis() - startTime) <= electionTimeout ) { return true; } else if ( roundCount < MAX_ROUNDS ) { roundCount++; startTime = clock.millis(); targetIndex = raftLog.appendIndex(); } } return false; } CatchupGoal( ReadableRaftLog raftLog, Clock clock, long electionTimeout );   }### Answer:
@Test public void goalAchievedWhenCatchupRoundDurationLessThanTarget() { FakeClock clock = Clocks.fakeClock(); long electionTimeout = 15; StubLog log = new StubLog(); log.setAppendIndex( 10 ); CatchupGoal goal = new CatchupGoal( log, clock, electionTimeout ); log.setAppendIndex( 20 ); clock.forward( 10, MILLISECONDS ); assertFalse( goal.achieved( new FollowerState() ) ); log.setAppendIndex( 30 ); clock.forward( 10, MILLISECONDS ); assertFalse( goal.achieved( new FollowerState().onSuccessResponse( 10 ) ) ); log.setAppendIndex( 40 ); clock.forward( 10, MILLISECONDS ); assertTrue( goal.achieved( new FollowerState().onSuccessResponse( 30 ) ) ); }