Program: 6875
Project: 6875
Buggy source:
@Category(SlowTests.class) @Test public void testConcurrentAdd() throws Exception {
  int numThreads=10;
  final Id.Artifact artifactId=Id.Artifact.from(Constants.DEFAULT_NAMESPACE_ID,"String_Node_Str","String_Node_Str");
  final List<String> successfulWriters=Collections.synchronizedList(Lists.<String>newArrayList());
  final CyclicBarrier barrier=new CyclicBarrier(numThreads);
  final CountDownLatch latch=new CountDownLatch(numThreads);
  ExecutorService executorService=Executors.newFixedThreadPool(numThreads);
  for (int i=0; i < numThreads; i++) {
    final String writer=String.valueOf(i);
    executorService.execute(new Runnable(){
      @Override public void run(){
        try {
          barrier.await();
          ArtifactMeta meta=new ArtifactMeta(ImmutableList.of(new PluginClass("String_Node_Str","String_Node_Str" + writer,"String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of())));
          artifactStore.write(artifactId,meta,new ByteArrayInputStream(Bytes.toBytes(writer)));
          successfulWriters.add(writer);
        }
 catch (        InterruptedException|BrokenBarrierException|IOException e) {
          throw new RuntimeException(e);
        }
catch (        ArtifactAlreadyExistsException|WriteConflictException e) {
        }
 finally {
          latch.countDown();
        }
      }
    }
);
  }
  latch.await();
  Assert.assertEquals(1,successfulWriters.size());
  String successfulWriter=successfulWriters.get(0);
  ArtifactInfo info=artifactStore.getArtifact(artifactId);
  ArtifactMeta expectedMeta=new ArtifactMeta(ImmutableList.of(new PluginClass("String_Node_Str","String_Node_Str" + successfulWriter,"String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of())));
  assertEqual(artifactId,expectedMeta,String.valueOf(successfulWriter),info);
}

Fixed version (ground truth):
@Category(SlowTests.class) @Test public void testConcurrentAdd() throws Exception {
  int numThreads=20;
  final Id.Artifact artifactId=Id.Artifact.from(Constants.DEFAULT_NAMESPACE_ID,"String_Node_Str","String_Node_Str");
  final List<String> successfulWriters=Collections.synchronizedList(Lists.<String>newArrayList());
  final CyclicBarrier barrier=new CyclicBarrier(numThreads);
  final CountDownLatch latch=new CountDownLatch(numThreads);
  ExecutorService executorService=Executors.newFixedThreadPool(numThreads);
  for (int i=0; i < numThreads; i++) {
    final String writer=String.valueOf(i);
    executorService.execute(new Runnable(){
      @Override public void run(){
        try {
          barrier.await();
          ArtifactMeta meta=new ArtifactMeta(ImmutableList.of(new PluginClass("String_Node_Str","String_Node_Str" + writer,"String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of())));
          artifactStore.write(artifactId,meta,new ByteArrayInputStream(Bytes.toBytes(writer)));
          successfulWriters.add(writer);
        }
 catch (        InterruptedException|BrokenBarrierException|IOException e) {
          throw new RuntimeException(e);
        }
catch (        ArtifactAlreadyExistsException|WriteConflictException e) {
        }
 finally {
          latch.countDown();
        }
      }
    }
);
  }
  latch.await();
  Assert.assertEquals(1,successfulWriters.size());
  String successfulWriter=successfulWriters.get(0);
  ArtifactInfo info=artifactStore.getArtifact(artifactId);
  ArtifactMeta expectedMeta=new ArtifactMeta(ImmutableList.of(new PluginClass("String_Node_Str","String_Node_Str" + successfulWriter,"String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of())));
  assertEqual(artifactId,expectedMeta,String.valueOf(successfulWriter),info);
}