Program: 186158
Project: 186158
Buggy source:
@Test public void simulataneous_cassandra_should_start_only_one_instance() throws Throwable {
  EmbeddedCassandra cassandraRule=newEmbeddedCassandraRule().build();
  cassandraRule.setEmbeddedCassandraServerHelper(embeddedCassandraServerHelper);
  Statement noStatement=new Statement(){
    @Override public void evaluate() throws Throwable {
      EmbeddedCassandra defaultEmbeddedCassandra=newEmbeddedCassandraRule().build();
      defaultEmbeddedCassandra.setEmbeddedCassandraServerHelper(embeddedCassandraServerHelper);
      Statement defaultNoStatement=new Statement(){
        @Override public void evaluate() throws Throwable {
          assertThat(ConnectionManagement.getInstance().isConnectionRegistered(EmbeddedCassandra.LOCALHOST,EmbeddedCassandra.PORT),is(true));
        }
      }
;
      Statement defaultStatement=defaultEmbeddedCassandra.apply(defaultNoStatement,Description.EMPTY);
      defaultStatement.evaluate();
      assertThat(ConnectionManagement.getInstance().isConnectionRegistered(EmbeddedCassandra.LOCALHOST,EmbeddedCassandra.PORT),is(true));
    }
  }
;
  Statement decotedStatement=cassandraRule.apply(noStatement,Description.EMPTY);
  decotedStatement.evaluate();
  verify(embeddedCassandraServerHelper).startEmbeddedCassandra(EmbeddedCassandra.DEFAULT_CASSANDRA_CONFIGURATION_FILE_LOCATION,EmbeddedCassandra.DEFAULT_CASSANDRA_TARGET_PATH);
  verify(embeddedCassandraServerHelper).stopEmbeddedCassandra();
  assertThat(ConnectionManagement.getInstance().isConnectionRegistered(EmbeddedCassandra.LOCALHOST,EmbeddedCassandra.PORT),is(false));
}

Fixed version (ground truth):
@Test public void simulataneous_cassandra_should_start_only_one_instance() throws Throwable {
  EmbeddedCassandra cassandraRule=newEmbeddedCassandraRule().build();
  cassandraRule.setEmbeddedCassandraServerHelper(embeddedCassandraServerHelper);
  Statement noStatement=new Statement(){
    @Override public void evaluate() throws Throwable {
      EmbeddedCassandra defaultEmbeddedCassandra=newEmbeddedCassandraRule().build();
      defaultEmbeddedCassandra.setEmbeddedCassandraServerHelper(embeddedCassandraServerHelper);
      Statement defaultNoStatement=new Statement(){
        @Override public void evaluate() throws Throwable {
          assertThat(ConnectionManagement.getInstance().isConnectionRegistered(EmbeddedCassandra.LOCALHOST,EmbeddedCassandra.DEFAULT_PORT),is(true));
        }
      }
;
      Statement defaultStatement=defaultEmbeddedCassandra.apply(defaultNoStatement,Description.EMPTY);
      defaultStatement.evaluate();
      assertThat(ConnectionManagement.getInstance().isConnectionRegistered(EmbeddedCassandra.LOCALHOST,EmbeddedCassandra.DEFAULT_PORT),is(true));
    }
  }
;
  Statement decotedStatement=cassandraRule.apply(noStatement,Description.EMPTY);
  decotedStatement.evaluate();
  verify(embeddedCassandraServerHelper).startEmbeddedCassandra(EmbeddedCassandra.DEFAULT_CASSANDRA_CONFIGURATION_FILE_LOCATION,EmbeddedCassandra.DEFAULT_CASSANDRA_TARGET_PATH);
  verify(embeddedCassandraServerHelper).stopEmbeddedCassandra();
  assertThat(ConnectionManagement.getInstance().isConnectionRegistered(EmbeddedCassandra.LOCALHOST,EmbeddedCassandra.DEFAULT_PORT),is(false));
}