protected void fireTransFinishedListeners() throws KettleException {
    // PDI-5229 sync added
    synchronized ( transListeners ) {
      if ( transListeners.size() == 0 ) {
        return;
      }
      // prevent Exception from one listener to block others execution
      List<KettleException> badGuys = new ArrayList<>( transListeners.size() );
      for ( TransListener transListener : transListeners ) {
        try {
          transListener.transFinished( this );
        } catch ( KettleException e ) {
          badGuys.add( e );
        }
      }
      if ( transFinishedBlockingQueue != null ) {
        // Signal for the the waitUntilFinished blocker...
        transFinishedBlockingQueue.add( new Object() );
      }
      if ( !badGuys.isEmpty() ) {
        // FIFO
        throw new KettleException( badGuys.get( 0 ) );
      }
    }
  }
@Test
  public void testFireTransFinishedListeners() throws Exception {
    TransListener mockListener = mock( TransListener.class );
    trans.setTransListeners( Collections.singletonList( mockListener ) );

    trans.fireTransFinishedListeners();

    verify( mockListener ).transFinished( trans );
  }