Program: 106411
Project: 106411
Buggy source:
public void dequeueFromAnyQueue(){
  final int queues=30;
  final int totalRuns=100;
  final int itemsPerRun=20;
  for (int q=1; q <= queues; q++)   for (int i=0; i < totalRuns; i++)   mgr.queue("String_Node_Str",q,"String_Node_Str",i + 1,1);
  count=0;
  Thread thread1=new Thread(new Runnable(){
    @Override public void run(){
      while (count < totalRuns * queues) {
        List<SyncQueueItemVO> l=mgr.dequeueFromAny(1L,itemsPerRun);
        if (l != null && l.size() > 0) {
          s_logger.info("String_Node_Str" + l.size() + "String_Node_Str");
          for (          SyncQueueItemVO item : l) {
            s_logger.info("String_Node_Str" + item.toString());
            count++;
            mgr.purgeItem(item.getId());
          }
        }
        try {
          Thread.sleep(getRandomMilliseconds(1,10));
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
);
  Thread thread2=new Thread(new Runnable(){
    @Override public void run(){
      while (count < totalRuns * queues) {
        List<SyncQueueItemVO> l=mgr.dequeueFromAny(1L,itemsPerRun);
        if (l != null && l.size() > 0) {
          s_logger.info("String_Node_Str" + l.size() + "String_Node_Str");
          for (          SyncQueueItemVO item : l) {
            s_logger.info("String_Node_Str" + item.toString());
            count++;
            mgr.purgeItem(item.getId());
          }
        }
        try {
          Thread.sleep(getRandomMilliseconds(1,10));
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
);
  thread1.start();
  thread2.start();
  try {
    thread1.join();
  }
 catch (  InterruptedException e) {
  }
  try {
    thread2.join();
  }
 catch (  InterruptedException e) {
  }
  Assert.assertEquals(queues * totalRuns,count);
}

Fixed version (ground truth):
public void dequeueFromAnyQueue(){
  final int queues=30;
  final int totalRuns=100;
  final int itemsPerRun=20;
  for (int q=1; q <= queues; q++)   for (int i=0; i < totalRuns; i++)   mgr.queue("String_Node_Str",q,"String_Node_Str",i + 1,1);
  count=0;
  Thread thread1=new Thread(new Runnable(){
    @Override public void run(){
      while (count < totalRuns * queues) {
        List<SyncQueueItemVO> l=mgr.dequeueFromAny(1L,itemsPerRun);
        if (l != null && l.size() > 0) {
          s_logger.info("String_Node_Str" + l.size() + "String_Node_Str");
          for (          SyncQueueItemVO item : l) {
            s_logger.info("String_Node_Str" + item.toString());
            count++;
            mgr.purgeItem(item.getId());
          }
        }
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
);
  Thread thread2=new Thread(new Runnable(){
    @Override public void run(){
      while (count < totalRuns * queues) {
        List<SyncQueueItemVO> l=mgr.dequeueFromAny(1L,itemsPerRun);
        if (l != null && l.size() > 0) {
          s_logger.info("String_Node_Str" + l.size() + "String_Node_Str");
          for (          SyncQueueItemVO item : l) {
            s_logger.info("String_Node_Str" + item.toString());
            count++;
            mgr.purgeItem(item.getId());
          }
        }
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
);
  thread1.start();
  thread2.start();
  try {
    thread1.join();
  }
 catch (  InterruptedException e) {
  }
  try {
    thread2.join();
  }
 catch (  InterruptedException e) {
  }
  Assert.assertEquals(queues * totalRuns,count);
}