Program: 8027
Project: 8027
Buggy source:
@Test public void testEvictOnAck_OneGroup() throws Exception {
  long dirtyVersion=getDirtyWriteVersion();
  ReadPointer dirtyReadPointer=getDirtyPointer();
  QueueConfig config=new QueueConfig(PartitionerType.FIFO,true);
  QueueConsumer consumer=new QueueConsumer(0,0,1,config);
  QueueConsumer consumer2=new QueueConsumer(0,1,1,config);
  TTQueue queueNormal=createQueue();
  int numGroups=-1;
  for (int i=0; i < 10; i++) {
    queueNormal.enqueue(new QueueEntry(Bytes.toBytes(i)),dirtyVersion);
  }
  for (int i=0; i < 10; i++) {
    DequeueResult result=queueNormal.dequeue(consumer,dirtyReadPointer);
    Assert.assertFalse(result.isEmpty());
    queueNormal.ack(result.getEntryPointer(),consumer,dirtyReadPointer);
    queueNormal.finalize(result.getEntryPointer(),consumer,numGroups,dirtyReadPointer.getMaximum());
  }
  assertTrue(queueNormal.dequeue(consumer,dirtyReadPointer).isEmpty());
  assertFalse(queueNormal.dequeue(consumer2,dirtyReadPointer).isEmpty());
  TTQueue queueEvict=createQueue();
  numGroups=1;
  for (int i=0; i < 10; i++) {
    queueEvict.enqueue(new QueueEntry(Bytes.toBytes(i)),dirtyVersion);
  }
  for (int i=0; i < 10; i++) {
    DequeueResult result=queueEvict.dequeue(consumer,dirtyReadPointer);
    queueEvict.ack(result.getEntryPointer(),consumer,dirtyReadPointer);
    queueEvict.finalize(result.getEntryPointer(),consumer,numGroups,dirtyReadPointer.getMaximum());
  }
  assertTrue(queueEvict.dequeue(consumer,dirtyReadPointer).isEmpty());
  assertTrue(queueEvict.dequeue(consumer2,dirtyReadPointer).isEmpty());
}

Fixed version (ground truth):
@Test public void testEvictOnAck_OneGroup() throws Exception {
  long dirtyVersion=getDirtyWriteVersion();
  ReadPointer dirtyReadPointer=getDirtyPointer();
  QueueConfig config=new QueueConfig(PartitionerType.FIFO,true);
  QueueConsumer consumer=new QueueConsumer(0,0,1,config);
  QueueConsumer consumer2=new QueueConsumer(0,1,1,config);
  TTQueue queueNormal=createQueue();
  int numGroups=-1;
  for (int i=0; i < 10; i++) {
    queueNormal.enqueue(new QueueEntry(Bytes.toBytes(i)),dirtyVersion);
  }
  for (int i=0; i < 10; i++) {
    DequeueResult result=queueNormal.dequeue(consumer,dirtyReadPointer);
    Assert.assertFalse(result.isEmpty());
    queueNormal.ack(result.getEntryPointer(),consumer,dirtyReadPointer);
    queueNormal.finalize(result.getEntryPointer(),consumer,numGroups,dirtyReadPointer.getMaximum());
  }
  assertTrue(queueNormal.dequeue(consumer,dirtyReadPointer).isEmpty());
  assertFalse(queueNormal.dequeue(consumer2,dirtyReadPointer).isEmpty());
  TTQueue queueEvict=createQueue();
  numGroups=1;
  for (int i=0; i < 10; i++) {
    queueEvict.enqueue(new QueueEntry(Bytes.toBytes(i)),dirtyVersion);
  }
  for (int i=0; i < 10; i++) {
    DequeueResult result=queueEvict.dequeue(consumer,dirtyReadPointer);
    queueEvict.ack(result.getEntryPointer(),consumer,dirtyReadPointer);
    queueEvict.finalize(result.getEntryPointer(),consumer,numGroups,dirtyReadPointer.getMaximum());
  }
  assertTrue(queueEvict.dequeue(consumer,dirtyReadPointer).isEmpty());
  DequeueResult result=queueEvict.dequeue(consumer2,dirtyReadPointer);
  assertTrue(result.toString(),result.isEmpty());
}