Program: 7378
Project: 7378
Buggy source:
@BeforeClass public static void beforeClass() throws IOException {
  zkServer=InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).build();
  zkServer.startAndWait();
  conf=CConfiguration.create();
  conf.set(Constants.Zookeeper.QUORUM,zkServer.getConnectionStr());
  conf.setInt(Constants.Stream.CONTAINER_INSTANCE_ID,0);
  conf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder().getAbsolutePath());
  injector=Guice.createInjector(Modules.override(new ZKClientModule(),new DataFabricModules().getInMemoryModules(),new ConfigModule(conf,new Configuration()),new AuthModule(),new DiscoveryRuntimeModule().getInMemoryModules(),new LocationRuntimeModule().getInMemoryModules(),new ExploreClientModule(),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(LevelDBStreamFileAdmin.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);
  zkClient.startAndWait();
  streamHttpService=injector.getInstance(StreamHttpService.class);
  streamHttpService.startAndWait();
  streamService=injector.getInstance(StreamService.class);
  streamService.startAndWait();
  heartbeatPublisher=(MockHeartbeatPublisher)injector.getInstance(HeartbeatPublisher.class);
  hostname=streamHttpService.getBindAddress().getHostName();
  port=streamHttpService.getBindAddress().getPort();
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass() throws IOException {
  zkServer=InMemoryZKServer.builder().setDataDir(TEMP_FOLDER.newFolder()).build();
  zkServer.startAndWait();
  conf=CConfiguration.create();
  conf.set(Constants.Zookeeper.QUORUM,zkServer.getConnectionStr());
  conf.setInt(Constants.Stream.CONTAINER_INSTANCE_ID,0);
  conf.set(Constants.CFG_LOCAL_DATA_DIR,TEMP_FOLDER.newFolder().getAbsolutePath());
  injector=Guice.createInjector(Modules.override(new ZKClientModule(),new DataFabricModules().getInMemoryModules(),new ConfigModule(conf,new Configuration()),new AuthModule(),new DiscoveryRuntimeModule().getInMemoryModules(),new LocationRuntimeModule().getInMemoryModules(),new ExploreClientModule(),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(LevelDBStreamFileAdmin.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);
  zkClient.startAndWait();
  streamHttpService=injector.getInstance(StreamHttpService.class);
  streamHttpService.startAndWait();
  streamService=injector.getInstance(StreamService.class);
  streamService.startAndWait();
  heartbeatPublisher=(MockHeartbeatPublisher)injector.getInstance(HeartbeatPublisher.class);
  hostname=streamHttpService.getBindAddress().getHostName();
  port=streamHttpService.getBindAddress().getPort();
}