Program: 40066
Project: 40066
Buggy source:
private void putWithSuccess(boolean raw,boolean withMeta){
  int batchSize=100;
  int total=1000;
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.RAW_CONF,String.valueOf(raw));
  config.put(SplunkSinkConnectorConfig.ACK_CONF,String.valueOf(true));
  config.put(SplunkSinkConnectorConfig.MAX_BATCH_SIZE_CONF,String.valueOf(batchSize));
  if (withMeta) {
    config.put(SplunkSinkConnectorConfig.INDEX_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCETYPE_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCE_CONF,"String_Node_Str");
  }
 else {
    config.put(SplunkSinkConnectorConfig.INDEX_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCETYPE_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCE_CONF,"String_Node_Str");
  }
  SplunkSinkTask task=new SplunkSinkTask();
  HecMock hec=new HecMock(task);
  hec.setSendReturnResult(HecMock.success);
  task.setHec(hec);
  task.start(config);
  task.put(createSinkRecords(total));
  Assert.assertEquals(10,hec.getBatches().size());
  if (raw && withMeta) {
    for (    EventBatch batch : hec.getBatches()) {
      RawEventBatch rb=(RawEventBatch)batch;
      Assert.assertEquals("String_Node_Str",rb.getIndex());
      Assert.assertEquals("String_Node_Str",rb.getSourcetype());
      Assert.assertEquals("String_Node_Str",rb.getSource());
    }
  }
  if (!raw) {
    int i=0;
    ;
    for (    EventBatch batch : hec.getBatches()) {
      int j=0;
      for (      Event event : batch.getEvents()) {
        int n=i * 100 + j;
        Assert.assertEquals(String.valueOf(n),event.getFields().get("String_Node_Str"));
        Assert.assertEquals(String.valueOf(1),event.getFields().get("String_Node_Str"));
        Assert.assertEquals(new UnitUtil().topics,event.getFields().get("String_Node_Str"));
        Assert.assertEquals(String.valueOf(0),event.getFields().get("String_Node_Str"));
        j++;
      }
      i++;
    }
  }
  Map<TopicPartition,OffsetAndMetadata> offsets=new HashMap<>();
  offsets.put(new TopicPartition(uu.topics,1),new OffsetAndMetadata(1000));
  Assert.assertEquals(offsets,task.preCommit(null));
  Assert.assertTrue(task.getTracker().getAndRemoveFailedRecords().isEmpty());
  task.stop();
}

Fixed version (ground truth):
private void putWithSuccess(boolean raw,boolean withMeta){
  int batchSize=100;
  int total=1000;
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.RAW_CONF,String.valueOf(raw));
  config.put(SplunkSinkConnectorConfig.ACK_CONF,String.valueOf(true));
  config.put(SplunkSinkConnectorConfig.MAX_BATCH_SIZE_CONF,String.valueOf(batchSize));
  if (withMeta) {
    config.put(SplunkSinkConnectorConfig.INDEX_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCETYPE_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCE_CONF,"String_Node_Str");
  }
 else {
    config.put(SplunkSinkConnectorConfig.INDEX_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCETYPE_CONF,"String_Node_Str");
    config.put(SplunkSinkConnectorConfig.SOURCE_CONF,"String_Node_Str");
  }
  SplunkSinkTask task=new SplunkSinkTask();
  HecMock hec=new HecMock(task);
  hec.setSendReturnResult(HecMock.success);
  task.setHec(hec);
  task.start(config);
  task.put(createSinkRecords(total));
  Assert.assertEquals(10,hec.getBatches().size());
  if (raw && withMeta) {
    for (    EventBatch batch : hec.getBatches()) {
      RawEventBatch rb=(RawEventBatch)batch;
      Assert.assertEquals("String_Node_Str",rb.getIndex());
      Assert.assertEquals("String_Node_Str",rb.getSourcetype());
      Assert.assertEquals("String_Node_Str",rb.getSource());
    }
  }
  if (!raw) {
    int i=0;
    ;
    for (    EventBatch batch : hec.getBatches()) {
      int j=0;
      for (      Event event : batch.getEvents()) {
        int n=i * 100 + j;
        Assert.assertEquals(String.valueOf(n),event.getFields().get("String_Node_Str"));
        Assert.assertEquals(String.valueOf(1),event.getFields().get("String_Node_Str"));
        Assert.assertEquals(new UnitUtil().topics,event.getFields().get("String_Node_Str"));
        Assert.assertEquals(String.valueOf(0),event.getFields().get("String_Node_Str"));
        j++;
      }
      i++;
    }
  }
  Map<TopicPartition,OffsetAndMetadata> offsets=new HashMap<>();
  offsets.put(new TopicPartition(uu.topics,1),new OffsetAndMetadata(1000));
  Assert.assertEquals(offsets,task.preCommit(new HashMap<>()));
  Assert.assertTrue(task.getTracker().getAndRemoveFailedRecords().isEmpty());
  task.stop();
}