Program: 10853
Project: 10853
Buggy source:
/** 
 * Test for   {@link MediaSessionStartedEvent}
 * @throws InterruptedException
 */
@Test public void testEventMediaSessionStarted() throws InterruptedException {
  final PlayerEndpoint player=pipeline.newPlayerEndpoint(URL_SMALL).build();
  player.connect(httpEp);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  player.addEndOfStreamListener(new MediaEventListener<EndOfStreamEvent>(){
    @Override public void onEvent(    EndOfStreamEvent event){
      eosLatch.countDown();
    }
  }
);
  final BlockingQueue<ListenerRegistration> events=new ArrayBlockingQueue<>(1);
  httpEp.addMediaSessionStartedListener(new MediaEventListener<MediaSessionStartedEvent>(){
    @Override public void onEvent(    MediaSessionStartedEvent event){
      player.play();
    }
  }
,new Continuation<ListenerRegistration>(){
    @Override public void onSuccess(    ListenerRegistration result){
      events.add(result);
    }
    @Override public void onError(    Throwable cause){
      throw new KurentoMediaFrameworkException(cause);
    }
  }
);
  ListenerRegistration reg=events.poll(500,MILLISECONDS);
  Assert.assertNotNull(reg);
  try (CloseableHttpClient httpclient=HttpClientBuilder.create().build()){
    httpclient.execute(new HttpGet(httpEp.getUrl()));
  }
 catch (  ClientProtocolException e) {
    throw new KurentoMediaFrameworkException();
  }
catch (  IOException e) {
    throw new KurentoMediaFrameworkException();
  }
  try {
    eosLatch.await(500,MILLISECONDS);
  }
 catch (  InterruptedException e) {
    player.release();
    throw new KurentoMediaFrameworkException(e);
  }
}

Fixed version (ground truth):
/** 
 * Test for   {@link MediaSessionStartedEvent}
 * @throws InterruptedException
 */
@Test public void testEventMediaSessionStarted() throws InterruptedException {
  final PlayerEndpoint player=pipeline.newPlayerEndpoint(URL_SMALL).build();
  player.connect(httpEp);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  player.addEndOfStreamListener(new MediaEventListener<EndOfStreamEvent>(){
    @Override public void onEvent(    EndOfStreamEvent event){
      eosLatch.countDown();
    }
  }
);
  final BlockingQueue<ListenerRegistration> events=new ArrayBlockingQueue<>(1);
  httpEp.addMediaSessionStartedListener(new MediaEventListener<MediaSessionStartedEvent>(){
    @Override public void onEvent(    MediaSessionStartedEvent event){
      player.play();
    }
  }
,new Continuation<ListenerRegistration>(){
    @Override public void onSuccess(    ListenerRegistration result){
      events.add(result);
    }
    @Override public void onError(    Throwable cause){
      throw new KurentoMediaFrameworkException(cause);
    }
  }
);
  ListenerRegistration reg=events.poll(500,MILLISECONDS);
  Assert.assertNotNull(reg);
  try (CloseableHttpClient httpclient=HttpClientBuilder.create().build()){
    httpclient.execute(new HttpGet(httpEp.getUrl()));
  }
 catch (  ClientProtocolException e) {
    throw new KurentoMediaFrameworkException();
  }
catch (  IOException e) {
    throw new KurentoMediaFrameworkException();
  }
  try {
    eosLatch.await(500,MILLISECONDS);
  }
  finally {
    player.release();
  }
}