Program: 92952
Project: 92952
Buggy source:
@SuppressWarnings("String_Node_Str") public void testRegister_Unregister_2(){
  TestProvider1 testProvider1=new TestProvider1(TmfEvent.class);
  TestProvider2 testProvider2=new TestProvider2(TmfEvent.class);
  TmfDataProvider<TmfEvent>[] providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 2);
  if (providers[0] == testProvider1) {
    assertTrue(providers[1] == testProvider2);
  }
 else {
    assertTrue(providers[1] == testProvider1);
    assertTrue(providers[0] == testProvider2);
  }
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider1);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider2.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider2);
  testProvider1.deregister();
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider2);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider2.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider2);
  testProvider2.deregister();
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider2.class);
  assertTrue(providers.length == 0);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void testRegister_Unregister_2(){
  TestProvider1 testProvider1=new TestProvider1(TmfEvent.class);
  TestProvider2 testProvider2=new TestProvider2(TmfEvent.class);
  TmfDataProvider<TmfEvent>[] providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 2);
  if (providers[0] == testProvider1) {
    assertTrue(providers[1] == testProvider2);
  }
 else {
    assertTrue(providers[1] == testProvider1);
    assertTrue(providers[0] == testProvider2);
  }
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider1);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider2.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider2);
  testProvider1.dispose();
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider2);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider2.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider2);
  testProvider2.dispose();
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider2.class);
  assertTrue(providers.length == 0);
}