Program: 7643
Project: 7643
Buggy source:
@Test public void configTest() throws Exception {
  QueueName queueName=QueueName.fromFlowlet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  String tableName=((HBaseQueueClientFactory)queueClientFactory).getConfigTableName(queueName);
  queueAdmin.configureGroups(queueName,ImmutableMap.of(1L,1,2L,2,3L,3));
  HTable hTable=testHBase.getHTable(Bytes.toBytes(tableName));
  try {
    byte[] rowKey=queueName.toBytes();
    Result result=hTable.get(new Get(rowKey));
    NavigableMap<byte[],byte[]> familyMap=result.getFamilyMap(QueueEntryRow.COLUMN_FAMILY);
    Assert.assertEquals(1 + 2 + 3,familyMap.size());
    Put put=new Put(rowKey);
    put.add(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,0),Bytes.toBytes(4));
    put.add(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,1),Bytes.toBytes(5));
    hTable.put(put);
    queueAdmin.configureInstances(queueName,2L,3);
    result=hTable.get(new Get(rowKey));
    int startRow=Bytes.toInt(result.getColumnLatest(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,2)).getValue());
    Assert.assertEquals(4,startRow);
    put=new Put(rowKey);
    put.add(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,0),Bytes.toBytes(7));
    hTable.put(put);
    queueAdmin.configureGroups(queueName,ImmutableMap.of(2L,1,4L,1));
    result=hTable.get(new Get(rowKey));
    startRow=Bytes.toInt(result.getColumnLatest(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,0)).getValue());
    Assert.assertEquals(4,startRow);
    result=hTable.get(new Get(rowKey));
    familyMap=result.getFamilyMap(QueueEntryRow.COLUMN_FAMILY);
    Assert.assertEquals(2,familyMap.size());
    startRow=Bytes.toInt(result.getColumnLatest(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(4L,0)).getValue());
    Assert.assertEquals(4,startRow);
  }
  finally {
    hTable.close();
    queueAdmin.dropAll();
  }
}

Fixed version (ground truth):
@Test public void configTest() throws Exception {
  QueueName queueName=QueueName.fromFlowlet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  String tableName=((HBaseQueueClientFactory)queueClientFactory).getConfigTableName(queueName);
  queueAdmin.configureGroups(queueName,ImmutableMap.of(1L,1,2L,2,3L,3));
  HTable hTable=testHBase.getHTable(Bytes.toBytes(tableName));
  try {
    byte[] rowKey=queueName.toBytes();
    Result result=hTable.get(new Get(rowKey));
    NavigableMap<byte[],byte[]> familyMap=result.getFamilyMap(QueueEntryRow.COLUMN_FAMILY);
    Assert.assertEquals(1 + 2 + 3,familyMap.size());
    Put put=new Put(rowKey);
    put.add(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,0),Bytes.toBytes(4));
    put.add(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,1),Bytes.toBytes(5));
    hTable.put(put);
    queueAdmin.configureInstances(queueName,2L,3);
    result=hTable.get(new Get(rowKey));
    for (int i=0; i < 3; i++) {
      int startRow=Bytes.toInt(result.getColumnLatest(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,i)).getValue());
      Assert.assertEquals(4,startRow);
    }
    put=new Put(rowKey);
    put.add(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,0),Bytes.toBytes(7));
    hTable.put(put);
    queueAdmin.configureGroups(queueName,ImmutableMap.of(2L,1,4L,1));
    result=hTable.get(new Get(rowKey));
    int startRow=Bytes.toInt(result.getColumnLatest(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(2L,0)).getValue());
    Assert.assertEquals(4,startRow);
    result=hTable.get(new Get(rowKey));
    familyMap=result.getFamilyMap(QueueEntryRow.COLUMN_FAMILY);
    Assert.assertEquals(2,familyMap.size());
    startRow=Bytes.toInt(result.getColumnLatest(QueueEntryRow.COLUMN_FAMILY,HBaseQueueAdmin.getConsumerStateColumn(4L,0)).getValue());
    Assert.assertEquals(4,startRow);
  }
  finally {
    hTable.close();
    queueAdmin.dropAll();
  }
}