### Question:
RaftLogShipper { public synchronized void onNewEntries( long prevLogIndex, long prevLogTerm, RaftLogEntry[] newLogEntries, LeaderContext leaderContext ) { if ( mode == Mode.PIPELINE ) { while ( lastSentIndex <= prevLogIndex ) { if ( prevLogIndex - matchIndex <= maxAllowedShippingLag ) { sendNewEntries( prevLogIndex, prevLogTerm, newLogEntries, leaderContext ); } else { log.info( "%s: follower has fallen behind (target prevLogIndex was %d, maxAllowedShippingLag " + "is %d), moving to CATCHUP mode", statusAsString(), prevLogIndex, maxAllowedShippingLag ); mode = Mode.CATCHUP; break; } } } lastLeaderContext = leaderContext; } RaftLogShipper( Outbound<MemberId, RaftMessages.RaftMessage> outbound, LogProvider logProvider,
                    ReadableRaftLog raftLog, Clock clock, TimerService timerService,
                    MemberId leader, MemberId follower, long leaderTerm, long leaderCommit, long retryTimeMillis,
                    int catchupBatchSize, int maxAllowedShippingLag, InFlightCache inFlightCache ); Object identity(); synchronized void start(); synchronized void stop(); synchronized void onMismatch( long lastRemoteAppendIndex, LeaderContext leaderContext ); synchronized void onMatch( long newMatchIndex, LeaderContext leaderContext ); synchronized void onNewEntries( long prevLogIndex, long prevLogTerm, RaftLogEntry[] newLogEntries,
                                           LeaderContext leaderContext ); synchronized void onCommitUpdate( LeaderContext leaderContext );  }### Answer:
@Test public void shouldNotSendNewEntriesWhenNotMatched() throws Throwable { raftLog.append( entry0 ); startLogShipper(); outbound.clear(); logShipper.onNewEntries( 0, 0, new RaftLogEntry[]{entry1}, new LeaderContext( 0, 0 ) ); logShipper.onNewEntries( 1, 0, new RaftLogEntry[]{entry2}, new LeaderContext( 0, 0 ) ); assertEquals( 0, outbound.sentTo( follower ).size() ); }