Program: 6384
Project: 6384
Buggy source:
@BeforeClass public static void beforeClass() throws IOException {
  zkServer=InMemoryZKServer.builder().setDataDir(TEMP_FOLDER.newFolder()).build();
  zkServer.startAndWait();
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Zookeeper.QUORUM,zkServer.getConnectionStr());
  cConf.setInt(Constants.Stream.CONTAINER_INSTANCE_ID,0);
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMP_FOLDER.newFolder().getAbsolutePath());
  Injector injector=Guice.createInjector(Modules.override(new ZKClientModule(),new DataFabricModules().getInMemoryModules(),new ConfigModule(cConf,new Configuration()),new DiscoveryRuntimeModule().getInMemoryModules(),new LocationRuntimeModule().getInMemoryModules(),new ExploreClientModule(),new DataSetServiceModules().getInMemoryModules(),new DataSetsModules().getStandaloneModules(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),new NotificationServiceRuntimeModule().getInMemoryModules(),new MetricsClientRuntimeModule().getInMemoryModules(),new ViewAdminModules().getInMemoryModules(),new StreamServiceRuntimeModule().getDistributedModules(),new StreamAdminModules().getInMemoryModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
      bind(StreamConsumerStateStoreFactory.class).to(LevelDBStreamConsumerStateStoreFactory.class).in(Singleton.class);
      bind(StreamAdmin.class).to(FileStreamAdmin.class).in(Singleton.class);
      bind(StreamConsumerFactory.class).to(LevelDBStreamFileConsumerFactory.class).in(Singleton.class);
      bind(StreamFileWriterFactory.class).to(LocationStreamFileWriterFactory.class).in(Singleton.class);
      bind(StreamFileJanitorService.class).to(LocalStreamFileJanitorService.class).in(Scopes.SINGLETON);
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class).in(Scopes.SINGLETON);
      bind(HeartbeatPublisher.class).to(MockHeartbeatPublisher.class).in(Scopes.SINGLETON);
    }
  }
),new NamespaceClientRuntimeModule().getDistributedModules());
  zkClient=injector.getInstance(ZKClientService.class);
  txManager=injector.getInstance(TransactionManager.class);
  datasetService=injector.getInstance(DatasetService.class);
  notificationService=injector.getInstance(NotificationService.class);
  streamHttpService=injector.getInstance(StreamHttpService.class);
  streamService=injector.getInstance(StreamService.class);
  heartbeatPublisher=(MockHeartbeatPublisher)injector.getInstance(HeartbeatPublisher.class);
  namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  streamAdmin=injector.getInstance(StreamAdmin.class);
  zkClient.startAndWait();
  txManager.startAndWait();
  datasetService.startAndWait();
  notificationService.startAndWait();
  streamHttpService.startAndWait();
  streamService.startAndWait();
  hostname=streamHttpService.getBindAddress().getHostName();
  port=streamHttpService.getBindAddress().getPort();
  Locations.mkdirsIfNotExists(namespacedLocationFactory.get(Id.Namespace.DEFAULT));
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass() throws IOException {
  zkServer=InMemoryZKServer.builder().setDataDir(TEMP_FOLDER.newFolder()).build();
  zkServer.startAndWait();
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Zookeeper.QUORUM,zkServer.getConnectionStr());
  cConf.setInt(Constants.Stream.CONTAINER_INSTANCE_ID,0);
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMP_FOLDER.newFolder().getAbsolutePath());
  Injector injector=Guice.createInjector(Modules.override(new ZKClientModule(),new DataFabricModules().getInMemoryModules(),new ConfigModule(cConf,new Configuration()),new DiscoveryRuntimeModule().getInMemoryModules(),new LocationRuntimeModule().getInMemoryModules(),new ExploreClientModule(),new DataSetServiceModules().getInMemoryModules(),new DataSetsModules().getStandaloneModules(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),new NotificationServiceRuntimeModule().getInMemoryModules(),new MetricsClientRuntimeModule().getInMemoryModules(),new ViewAdminModules().getInMemoryModules(),new StreamServiceRuntimeModule().getDistributedModules(),new StreamAdminModules().getInMemoryModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
      bind(AbstractNamespaceClient.class).to(InMemoryNamespaceClient.class);
      bind(StreamConsumerStateStoreFactory.class).to(LevelDBStreamConsumerStateStoreFactory.class).in(Singleton.class);
      bind(StreamAdmin.class).to(FileStreamAdmin.class).in(Singleton.class);
      bind(StreamConsumerFactory.class).to(LevelDBStreamFileConsumerFactory.class).in(Singleton.class);
      bind(StreamFileWriterFactory.class).to(LocationStreamFileWriterFactory.class).in(Singleton.class);
      bind(StreamFileJanitorService.class).to(LocalStreamFileJanitorService.class).in(Scopes.SINGLETON);
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class).in(Scopes.SINGLETON);
      bind(HeartbeatPublisher.class).to(MockHeartbeatPublisher.class).in(Scopes.SINGLETON);
    }
  }
));
  zkClient=injector.getInstance(ZKClientService.class);
  txManager=injector.getInstance(TransactionManager.class);
  datasetService=injector.getInstance(DatasetService.class);
  notificationService=injector.getInstance(NotificationService.class);
  streamHttpService=injector.getInstance(StreamHttpService.class);
  streamService=injector.getInstance(StreamService.class);
  heartbeatPublisher=(MockHeartbeatPublisher)injector.getInstance(HeartbeatPublisher.class);
  namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  streamAdmin=injector.getInstance(StreamAdmin.class);
  zkClient.startAndWait();
  txManager.startAndWait();
  datasetService.startAndWait();
  notificationService.startAndWait();
  streamHttpService.startAndWait();
  streamService.startAndWait();
  hostname=streamHttpService.getBindAddress().getHostName();
  port=streamHttpService.getBindAddress().getPort();
  Locations.mkdirsIfNotExists(namespacedLocationFactory.get(Id.Namespace.DEFAULT));
}