Program: 7069
Project: 7069
Buggy source:
@Test public void testBatchAdapters() throws Exception {
  String adapterName="String_Node_Str";
  DummyBatchTemplate.Config config=new DummyBatchTemplate.Config("String_Node_Str","String_Node_Str");
  AdapterConfig adapterConfig=new AdapterConfig("String_Node_Str",DummyBatchTemplate.NAME,GSON.toJsonTree(config));
  adapterService.createAdapter(NAMESPACE,adapterName,adapterConfig);
  PreferencesStore preferencesStore=getInjector().getInstance(PreferencesStore.class);
  Map<String,String> prop=preferencesStore.getResolvedProperties(TEST_NAMESPACE1,adapterConfig.getTemplate());
  Assert.assertTrue(Boolean.parseBoolean(prop.get(ProgramOptionConstants.CONCURRENT_RUNS_ENABLED)));
  try {
    adapterService.createAdapter(NAMESPACE,adapterName,adapterConfig);
    Assert.fail("String_Node_Str");
  }
 catch (  AdapterAlreadyExistsException expected) {
  }
  AdapterDefinition actualAdapterSpec=adapterService.getAdapter(NAMESPACE,adapterName);
  Assert.assertNotNull(actualAdapterSpec);
  assertDummyConfigEquals(adapterConfig,actualAdapterSpec);
  Collection<AdapterDefinition> adapters=adapterService.getAdapters(NAMESPACE,DummyBatchTemplate.NAME);
  Assert.assertEquals(1,adapters.size());
  AdapterDefinition actual=adapters.iterator().next();
  assertDummyConfigEquals(adapterConfig,actual);
  Assert.assertEquals(AdapterStatus.STOPPED,adapterService.getAdapterStatus(NAMESPACE,adapterName));
  adapterService.startAdapter(NAMESPACE,adapterName);
  Assert.assertEquals(AdapterStatus.STARTED,adapterService.getAdapterStatus(NAMESPACE,adapterName));
  adapterService.stopAdapter(NAMESPACE,adapterName);
  Assert.assertEquals(AdapterStatus.STOPPED,adapterService.getAdapterStatus(NAMESPACE,adapterName));
  adapterService.removeAdapter(NAMESPACE,adapterName);
  try {
    adapterService.getAdapter(NAMESPACE,adapterName);
    Assert.fail(String.format("String_Node_Str",adapterName));
  }
 catch (  AdapterNotFoundException expected) {
  }
  adapters=adapterService.getAdapters(NAMESPACE,DummyBatchTemplate.NAME);
  Assert.assertTrue(adapters.isEmpty());
}

Fixed version (ground truth):
@Test public void testBatchAdapters() throws Exception {
  String adapterName="String_Node_Str";
  DummyBatchTemplate.Config config=new DummyBatchTemplate.Config("String_Node_Str","String_Node_Str");
  AdapterConfig adapterConfig=new AdapterConfig("String_Node_Str",DummyBatchTemplate.NAME,GSON.toJsonTree(config));
  adapterService.createAdapter(NAMESPACE,adapterName,adapterConfig);
  PreferencesStore preferencesStore=getInjector().getInstance(PreferencesStore.class);
  Map<String,String> prop=preferencesStore.getResolvedProperties(TEST_NAMESPACE1,adapterConfig.getTemplate());
  Assert.assertTrue(Boolean.parseBoolean(prop.get(ProgramOptionConstants.CONCURRENT_RUNS_ENABLED)));
  try {
    adapterService.createAdapter(NAMESPACE,adapterName,adapterConfig);
    Assert.fail("String_Node_Str");
  }
 catch (  AdapterAlreadyExistsException expected) {
  }
  AdapterDefinition actualAdapterSpec=adapterService.getAdapter(NAMESPACE,adapterName);
  Assert.assertNotNull(actualAdapterSpec);
  assertDummyConfigEquals(adapterConfig,actualAdapterSpec);
  Collection<AdapterDefinition> adapters=adapterService.getAdapters(NAMESPACE,DummyBatchTemplate.NAME);
  Assert.assertEquals(1,adapters.size());
  AdapterDefinition actual=adapters.iterator().next();
  assertDummyConfigEquals(adapterConfig,actual);
  Assert.assertEquals(AdapterStatus.STOPPED,adapterService.getAdapterStatus(NAMESPACE,adapterName));
  adapterService.startAdapter(NAMESPACE,adapterName);
  Assert.assertEquals(AdapterStatus.STARTED,adapterService.getAdapterStatus(NAMESPACE,adapterName));
  adapterService.stopAdapter(NAMESPACE,adapterName);
  Assert.assertEquals(AdapterStatus.STOPPED,adapterService.getAdapterStatus(NAMESPACE,adapterName));
  adapterService.removeAdapters(NAMESPACE);
  try {
    adapterService.getAdapter(NAMESPACE,adapterName);
    Assert.fail(String.format("String_Node_Str",adapterName));
  }
 catch (  AdapterNotFoundException expected) {
  }
  adapters=adapterService.getAdapters(NAMESPACE,DummyBatchTemplate.NAME);
  Assert.assertTrue(adapters.isEmpty());
}