Program: 6221
Project: 6221
Buggy source:
@Test public void testAddGetSingleArtifact() throws Exception {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  PluginClass plugin1=new PluginClass("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of());
  PluginClass plugin2=new PluginClass("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of());
  List<PluginClass> plugins=ImmutableList.of(plugin1,plugin2);
  ApplicationClass appClass=new ApplicationClass(InspectionApp.class.getName(),"String_Node_Str",new ReflectionSchemaGenerator().generate(InspectionApp.AConfig.class));
  ArtifactMeta artifactMeta=new ArtifactMeta(ArtifactClasses.builder().addPlugins(plugins).addApp(appClass).build());
  String artifactContents="String_Node_Str";
  writeArtifact(artifactId,artifactMeta,artifactContents);
  ArtifactDetail artifactDetail=artifactStore.getArtifact(artifactId);
  assertEqual(artifactId,artifactMeta,artifactContents,artifactDetail);
  Map<ArtifactDescriptor,List<PluginClass>> pluginsMap=artifactStore.getPluginClasses(NamespaceId.DEFAULT,artifactId);
  Assert.assertEquals(1,pluginsMap.size());
  Assert.assertTrue(pluginsMap.containsKey(artifactDetail.getDescriptor()));
  Set<PluginClass> expected=ImmutableSet.copyOf(plugins);
  Set<PluginClass> actual=ImmutableSet.copyOf(pluginsMap.get(artifactDetail.getDescriptor()));
  Assert.assertEquals(expected,actual);
  pluginsMap=artifactStore.getPluginClasses(NamespaceId.DEFAULT,artifactId,"String_Node_Str");
  Assert.assertEquals(1,pluginsMap.size());
  Assert.assertTrue(pluginsMap.containsKey(artifactDetail.getDescriptor()));
  expected=ImmutableSet.copyOf(plugins);
  actual=ImmutableSet.copyOf(pluginsMap.get(artifactDetail.getDescriptor()));
  Assert.assertEquals(expected,actual);
  Map<ArtifactDescriptor,PluginClass> pluginClasses=artifactStore.getPluginClasses(NamespaceId.DEFAULT,artifactId,"String_Node_Str","String_Node_Str");
  Assert.assertEquals(1,pluginClasses.size());
  Assert.assertTrue(pluginClasses.containsKey(artifactDetail.getDescriptor()));
  Assert.assertEquals(plugin2,pluginClasses.get(artifactDetail.getDescriptor()));
}

Fixed version (ground truth):
@Test public void testAddGetSingleArtifact() throws Exception {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  PluginClass plugin1=new PluginClass("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of());
  PluginClass plugin2=new PluginClass("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of());
  PluginClass plugin3=new PluginClass("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",ImmutableMap.<String,PluginPropertyField>of());
  List<PluginClass> plugins=ImmutableList.of(plugin1,plugin2,plugin3);
  ApplicationClass appClass=new ApplicationClass(InspectionApp.class.getName(),"String_Node_Str",new ReflectionSchemaGenerator().generate(InspectionApp.AConfig.class));
  ArtifactMeta artifactMeta=new ArtifactMeta(ArtifactClasses.builder().addPlugins(plugins).addApp(appClass).build());
  String artifactContents="String_Node_Str";
  writeArtifact(artifactId,artifactMeta,artifactContents);
  ArtifactDetail artifactDetail=artifactStore.getArtifact(artifactId);
  assertEqual(artifactId,artifactMeta,artifactContents,artifactDetail);
  Map<ArtifactDescriptor,List<PluginClass>> pluginsMap=artifactStore.getPluginClasses(NamespaceId.DEFAULT,artifactId);
  Assert.assertEquals(1,pluginsMap.size());
  Assert.assertTrue(pluginsMap.containsKey(artifactDetail.getDescriptor()));
  Set<PluginClass> expected=ImmutableSet.copyOf(plugins);
  Set<PluginClass> actual=ImmutableSet.copyOf(pluginsMap.get(artifactDetail.getDescriptor()));
  Assert.assertEquals(expected,actual);
  pluginsMap=artifactStore.getPluginClasses(NamespaceId.DEFAULT,artifactId,"String_Node_Str");
  Assert.assertEquals(1,pluginsMap.size());
  Assert.assertTrue(pluginsMap.containsKey(artifactDetail.getDescriptor()));
  expected=ImmutableSet.of(plugin1,plugin2);
  actual=ImmutableSet.copyOf(pluginsMap.get(artifactDetail.getDescriptor()));
  Assert.assertEquals(expected,actual);
  Map<ArtifactDescriptor,PluginClass> pluginClasses=artifactStore.getPluginClasses(NamespaceId.DEFAULT,artifactId,"String_Node_Str","String_Node_Str");
  Assert.assertEquals(1,pluginClasses.size());
  Assert.assertTrue(pluginClasses.containsKey(artifactDetail.getDescriptor()));
  Assert.assertEquals(plugin3,pluginClasses.get(artifactDetail.getDescriptor()));
}