Program: 92954
Project: 92954
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void testConsumerNormalOps() throws InterruptedException, ExecutionException {
  final List<ConsumerRecord<byte[],byte[]>> referenceRecords=Arrays.<ConsumerRecord<byte[],byte[]>>asList(new BinaryConsumerRecord("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),0,0),new BinaryConsumerRecord("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),1,0),new BinaryConsumerRecord("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),2,0));
  Map<Integer,List<ConsumerRecord<byte[],byte[]>>> referenceSchedule=new HashMap<Integer,List<ConsumerRecord<byte[],byte[]>>>();
  referenceSchedule.put(50,referenceRecords);
  Map<String,List<Map<Integer,List<ConsumerRecord<byte[],byte[]>>>>> schedules=new HashMap<String,List<Map<Integer,List<ConsumerRecord<byte[],byte[]>>>>>();
  schedules.put(topicName,Arrays.asList(referenceSchedule));
  expectCreate(schedules);
  EasyMock.expect(mdObserver.topicExists(topicName)).andReturn(true);
  EasyMock.replay(mdObserver,consumerFactory);
  String cid=consumerManager.createConsumer(groupName,new ConsumerInstanceConfig(EmbeddedFormat.BINARY));
  sawCallback=false;
  actualException=null;
  actualRecords=null;
  consumerManager.readTopic(groupName,cid,topicName,BinaryConsumerState.class,Long.MAX_VALUE,new ConsumerManager.ReadCallback<byte[],byte[]>(){
    @Override public void onCompletion(    List<? extends ConsumerRecord<byte[],byte[]>> records,    Exception e){
      actualException=e;
      actualRecords=records;
      sawCallback=true;
      assertTrue("String_Node_Str",false);
    }
  }
).get();
  assertTrue("String_Node_Str",sawCallback);
  assertNull("String_Node_Str",actualException);
  assertEquals("String_Node_Str",referenceRecords,actualRecords);
  assertEquals(config.getInt(KafkaRestConfig.CONSUMER_REQUEST_TIMEOUT_MS_CONFIG) + config.getInt(KafkaRestConfig.CONSUMER_ITERATOR_TIMEOUT_MS_CONFIG),config.getTime().milliseconds());
  sawCallback=false;
  actualException=null;
  actualOffsets=null;
  consumerManager.commitOffsets(groupName,cid,new ConsumerManager.CommitCallback(){
    @Override public void onCompletion(    List<TopicPartitionOffset> offsets,    Exception e){
      sawCallback=true;
      actualException=e;
      actualOffsets=offsets;
    }
  }
).get();
  assertTrue("String_Node_Str",sawCallback);
  assertNull("String_Node_Str",actualException);
  assertNotNull("String_Node_Str",actualOffsets);
  assertEquals("String_Node_Str",3,actualOffsets.size());
  consumerManager.deleteConsumer(groupName,cid);
  EasyMock.verify(mdObserver,consumerFactory);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testConsumerNormalOps() throws InterruptedException, ExecutionException {
  final List<ConsumerRecord<byte[],byte[]>> referenceRecords=Arrays.<ConsumerRecord<byte[],byte[]>>asList(new BinaryConsumerRecord("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),0,0),new BinaryConsumerRecord("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),1,0),new BinaryConsumerRecord("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),2,0));
  Map<Integer,List<ConsumerRecord<byte[],byte[]>>> referenceSchedule=new HashMap<Integer,List<ConsumerRecord<byte[],byte[]>>>();
  referenceSchedule.put(50,referenceRecords);
  Map<String,List<Map<Integer,List<ConsumerRecord<byte[],byte[]>>>>> schedules=new HashMap<String,List<Map<Integer,List<ConsumerRecord<byte[],byte[]>>>>>();
  schedules.put(topicName,Arrays.asList(referenceSchedule));
  expectCreate(schedules);
  EasyMock.expect(mdObserver.topicExists(topicName)).andReturn(true);
  EasyMock.replay(mdObserver,consumerFactory);
  String cid=consumerManager.createConsumer(groupName,new ConsumerInstanceConfig(EmbeddedFormat.BINARY));
  sawCallback=false;
  actualException=null;
  actualRecords=null;
  consumerManager.readTopic(groupName,cid,topicName,BinaryConsumerState.class,Long.MAX_VALUE,new ConsumerManager.ReadCallback<byte[],byte[]>(){
    @Override public void onCompletion(    List<? extends ConsumerRecord<byte[],byte[]>> records,    Exception e){
      actualException=e;
      actualRecords=records;
      sawCallback=true;
      assertTrue("String_Node_Str",false);
    }
  }
).get();
  assertTrue("String_Node_Str",sawCallback);
  assertNull("String_Node_Str",actualException);
  assertEquals("String_Node_Str",referenceRecords,actualRecords);
  String msg="String_Node_Str" + Long.toString(config.getTime().milliseconds()) + "String_Node_Str"+ Integer.toString(config.getInt(KafkaRestConfig.CONSUMER_REQUEST_TIMEOUT_MS_CONFIG) + config.getInt(KafkaRestConfig.CONSUMER_ITERATOR_TIMEOUT_MS_CONFIG));
  assertFalse(msg,config.getInt(KafkaRestConfig.CONSUMER_REQUEST_TIMEOUT_MS_CONFIG) + config.getInt(KafkaRestConfig.CONSUMER_ITERATOR_TIMEOUT_MS_CONFIG) >= config.getTime().milliseconds());
  sawCallback=false;
  actualException=null;
  actualOffsets=null;
  consumerManager.commitOffsets(groupName,cid,new ConsumerManager.CommitCallback(){
    @Override public void onCompletion(    List<TopicPartitionOffset> offsets,    Exception e){
      sawCallback=true;
      actualException=e;
      actualOffsets=offsets;
    }
  }
).get();
  assertTrue("String_Node_Str",sawCallback);
  assertNull("String_Node_Str",actualException);
  assertNotNull("String_Node_Str",actualOffsets);
  assertEquals("String_Node_Str",3,actualOffsets.size());
  consumerManager.deleteConsumer(groupName,cid);
  EasyMock.verify(mdObserver,consumerFactory);
}