Buggy code:
public class ReplicationTest extends LiteTestCase { public void testGoOnlinePuller ( ) throws Exception { } public void testStartReplicationClosedDb ( ) throws Exception { } public void failingTestStartReplicationStartStop ( ) throws Exception { } public void testMockSinglePullSyncGw ( ) throws Exception { } public void testMockSinglePullCouchDb ( ) throws Exception { } public void testMockSinglePullCouchDbAttachments ( ) throws Exception { } public void testMockSinglePullSyncGwAttachments ( ) throws Exception { } public void testMockMultiplePullSyncGw ( ) throws Exception { } public void testMockMultiplePullCouchDb ( ) throws Exception { } public void testMockContinuousPullCouchDb ( ) throws Exception { } public Map < String , Object > mockSinglePull ( boolean shutdownMockWebserver , MockDispatcher . ServerType serverType , boolean addAttachments ) throws Exception { } public Map < String , Object > mockMultiplePull ( boolean shutdownMockWebserver , MockDispatcher . ServerType serverType ) throws Exception { } public Map < String , Object > mockContinuousPull ( boolean shutdownMockWebserver , MockDispatcher . ServerType serverType ) throws Exception { } public void testAttachmentsDeletedOnPull ( ) throws Exception { } public void testPullerWithLiveQuery ( ) throws Throwable { } public void testContinuousPushRetryBehavior ( ) throws Exception { RemoteRequestRetry . RETRY_DELAY_MS = 5 ; ReplicationInternal . RETRY_DELAY_SECONDS = 1 ; ReplicationInternal . MAX_RETRIES = 3 ; MockDispatcher dispatcher = new MockDispatcher ( ) ; MockWebServer server = MockHelper . getMockWebServer ( dispatcher ) ; dispatcher . setServerType ( SYNC_GW ) ; MockCheckpointPut mockCheckpointPut = new MockCheckpointPut ( ) ; mockCheckpointPut . setSticky ( true ) ; mockCheckpointPut . setDelayMs ( 500 ) ; dispatcher . enqueueResponse ( PATH_REGEX_CHECKPOINT , mockCheckpointPut ) ; MockRevsDiff mockRevsDiff = new MockRevsDiff ( ) ; mockRevsDiff . setSticky ( true ) ; dispatcher . enqueueResponse ( PATH_REGEX_REVS_DIFF , mockRevsDiff ) ; MockResponse mockResponse = new MockResponse ( ) . setResponseCode ( 503 ) ; WrappedSmartMockResponse mockBulkDocs = new WrappedSmartMockResponse ( mockResponse , false ) ; mockBulkDocs . setSticky ( true ) ; dispatcher . enqueueResponse ( PATH_REGEX_BULK_DOCS , mockBulkDocs ) ; server . play ( ) ; Replication replication = database . createPushReplication ( server . getUrl ( "//db" ) ) ; replication . setContinuous ( true ) ; CountDownLatch replicationIdle = new CountDownLatch ( 1 ) ; ReplicationIdleObserver idleObserver = new ReplicationIdleObserver ( replicationIdle ) ; replication . addChangeListener ( idleObserver ) ; replication . start ( ) ; boolean success = replicationIdle . await ( 30 , TimeUnit . SECONDS ) ; assertTrue ( success ) ; replication . removeChangeListener ( idleObserver ) ; Document doc1 = createDocumentForPushReplication ( "doc1" , null , null ) ; int numAttempts = ( RemoteRequestRetry . MAX_RETRIES ) + 1 ; for ( int i = 0 ; i < numAttempts ; i ++ ) { RecordedRequest request = dispatcher . takeRequestBlocking ( PATH_REGEX_BULK_DOCS ) ; assertNotNull ( request ) ; dispatcher . takeRecordedResponseBlocking ( request ) ; } <START_BUG> for ( int j = 0 ; j < ( RemoteRequestRetry . MAX_RETRIES ) ; j ++ ) { <END_BUG> for ( int i = 0 ; i < numAttempts ; i ++ ) { RecordedRequest request = dispatcher . takeRequestBlocking ( PATH_REGEX_BULK_DOCS ) ; assertNotNull ( request ) ; dispatcher . takeRecordedResponseBlocking ( request ) ; } } stopReplication ( replication ) ; server . shutdown ( ) ; } public void testMockSinglePush ( ) throws Exception { } public Map < String , Object > mockSinglePush ( boolean shutdownMockWebserver , MockDispatcher . ServerType serverType ) throws Exception { } private void workAroundSaveCheckpointRaceCondition ( ) throws InterruptedException { } public void testContinuousPushReplicationGoesIdle ( ) throws Exception { } public void testContinuousReplication404Changes ( ) throws Exception { } public void testAllLeafRevisionsArePushed ( ) throws Exception { } public void testRemoteConflictResolution ( ) throws Exception { } public void testPushReplicationCanMissDocs ( ) throws Exception { } public void testPushUpdatedDocWithoutReSendingAttachments ( ) throws Exception { } public void testServerDoesNotSupportMultipart ( ) throws Exception { } public void testServerIsSyncGatewayVersion ( ) { } public void testDifferentCheckpointsFilteredReplication ( ) throws Exception { } public void testSetReplicationCookie ( ) throws Exception { } public void testChangesFeedWithPurgedDoc ( ) throws Exception { } public void testPushPurgedDoc ( ) throws Throwable { } public void testPusherBatching ( ) throws Throwable { } public void failingTestPullerGzipped ( ) throws Throwable { } public void testValidationBlockCalled ( ) throws Throwable { } public void testMockPullerRestart ( ) throws Exception { } public void testRunReplicationWithError ( ) throws Exception { } public void testBuildRelativeURLString ( ) throws Exception { } public void testBuildRelativeURLStringWithLeadingSlash ( ) throws Exception { } public void testChannels ( ) throws Exception { } public void testChannelsMore ( ) throws CouchbaseLiteException , MalformedURLException { } public void testPushReplicationRecoverableError ( ) throws Exception { } public void testPushReplicationNonRecoverableError ( ) throws Exception { } public void runPushReplicationWithTransientError ( String status , boolean expectReplicatorError ) throws Exception { } public void testOneShotReplicationErrorNotification ( ) throws Throwable { } public void testContinuousReplicationErrorNotification ( ) throws Throwable { } public void testGoOffline ( ) throws Exception { } private void putReplicationOffline ( Replication replication ) throws InterruptedException { } private void putReplicationOnline ( Replication replication ) throws InterruptedException { } public void testReplicationOnlineExtraneousChangeTrackers ( ) throws Exception { } public void testGoOfflinePusher ( ) throws Exception { } public void testReplicatorErrorStatus ( ) throws Exception { } public void testGetReplicator ( ) throws Throwable { } public void testGetReplicatorWithAuth ( ) throws Throwable { } public void testPutCheckpoint409Recovery ( ) throws Exception { } public void failingTestVerifyPullerInsertsDocsWithValidation ( ) throws Exception { } public void testChannelsFilter ( ) throws Exception { } public void testContinuousPullEntersIdleState ( ) throws Exception { } public void testMockPullBulkDocsSyncGw ( ) throws Exception { } public void mockPullBulkDocs ( MockDispatcher . ServerType serverType ) throws Exception { } public void testCheckSessionAtPath ( ) throws Exception { } public void testChangeTrackerError ( ) throws Exception { } public void testContinuousPushReplicationGoesIdleTwice ( ) throws Exception { } public void testContinuousPushReplicationGoesIdleTooSoon ( ) throws Exception { } }

Fix:
for ( int j = 0 ; j < ( ReplicationInternal . MAX_RETRIES ) ; j ++ ) {