Program: 160284
Project: 160284
Buggy source:
public void changeTrackerTestWithMode(ChangeTracker.ChangeTrackerMode mode,final boolean useMockReplicator,final boolean checkLastException) throws Throwable {
  final CountDownLatch changeTrackerFinishedSignal=new CountDownLatch(1);
  final CountDownLatch changeReceivedSignal=new CountDownLatch(1);
  URL testURL=getReplicationURL();
  ChangeTrackerClient client=new ChangeTrackerClient(){
    @Override public String getUserAgent(){
      return manager.getUserAgent();
    }
    @Override public void changeTrackerStopped(    ChangeTracker tracker){
      changeTrackerFinishedSignal.countDown();
    }
    @Override public void changeTrackerFinished(    ChangeTracker tracker){
    }
    @Override public void changeTrackerCaughtUp(){
    }
    @Override public void changeTrackerReceivedChange(    Map<String,Object> change){
      Object seq=change.get("String_Node_Str");
      if (useMockReplicator) {
        assertEquals("String_Node_Str",seq.toString());
      }
      changeReceivedSignal.countDown();
    }
    @Override public HttpClient getHttpClient(){
      if (useMockReplicator) {
        CustomizableMockHttpClient mockHttpClient=new CustomizableMockHttpClient();
        mockHttpClient.setResponder("String_Node_Str",new CustomizableMockHttpClient.Responder(){
          @Override public HttpResponse execute(          HttpUriRequest httpUriRequest) throws IOException {
            String json="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
            return CustomizableMockHttpClient.generateHttpResponseObject(json);
          }
        }
);
        return mockHttpClient;
      }
 else {
        return new DefaultHttpClient();
      }
    }
  }
;
  final ChangeTracker changeTracker=new ChangeTracker(testURL,mode,false,0,client);
  changeTracker.setUsePOST(isTestingAgainstSyncGateway());
  changeTracker.start();
  try {
    boolean success=changeReceivedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  changeTracker.stop();
  try {
    boolean success=changeTrackerFinishedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  if (checkLastException) {
    if (changeTracker.getLastError() != null) {
      Log.e(TAG,changeTracker.getLastError().toString());
      assertFalse(changeTracker.getLastError() instanceof NullPointerException);
    }
  }
}

Fixed version (ground truth):
public void changeTrackerTestWithMode(ChangeTracker.ChangeTrackerMode mode,final boolean useMockReplicator,final boolean checkLastException) throws Throwable {
  final CountDownLatch changeTrackerFinishedSignal=new CountDownLatch(1);
  final CountDownLatch changeReceivedSignal=new CountDownLatch(1);
  URL testURL=getReplicationURL();
  ChangeTrackerClient client=new ChangeTrackerClient(){
    @Override public void changeTrackerStopped(    ChangeTracker tracker){
      changeTrackerFinishedSignal.countDown();
    }
    @Override public void changeTrackerFinished(    ChangeTracker tracker){
    }
    @Override public void changeTrackerCaughtUp(){
    }
    @Override public void changeTrackerReceivedChange(    Map<String,Object> change){
      Object seq=change.get("String_Node_Str");
      if (useMockReplicator) {
        assertEquals("String_Node_Str",seq.toString());
      }
      changeReceivedSignal.countDown();
    }
    @Override public HttpClient getHttpClient(){
      if (useMockReplicator) {
        CustomizableMockHttpClient mockHttpClient=new CustomizableMockHttpClient();
        mockHttpClient.setResponder("String_Node_Str",new CustomizableMockHttpClient.Responder(){
          @Override public HttpResponse execute(          HttpUriRequest httpUriRequest) throws IOException {
            String json="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
            return CustomizableMockHttpClient.generateHttpResponseObject(json);
          }
        }
);
        return mockHttpClient;
      }
 else {
        return new DefaultHttpClient();
      }
    }
  }
;
  final ChangeTracker changeTracker=new ChangeTracker(testURL,mode,false,0,client);
  changeTracker.setUsePOST(isTestingAgainstSyncGateway());
  changeTracker.start();
  try {
    boolean success=changeReceivedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  changeTracker.stop();
  try {
    boolean success=changeTrackerFinishedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  if (checkLastException) {
    if (changeTracker.getLastError() != null) {
      Log.e(TAG,changeTracker.getLastError().toString());
      assertFalse(changeTracker.getLastError() instanceof NullPointerException);
    }
  }
}