@VisibleForTesting
  JobMeta filterPrivateDatabases( JobMeta jobMeta ) {
    Set<String> privateDatabases = jobMeta.getPrivateDatabases();
    if ( privateDatabases != null ) {
      // keep only private transformation databases
      for ( Iterator<DatabaseMeta> it = jobMeta.getDatabases().iterator(); it.hasNext(); ) {
        DatabaseMeta databaseMeta = it.next();
        String databaseName = databaseMeta.getName();
        if ( !privateDatabases.contains( databaseName ) && !jobMeta.isDatabaseConnectionUsed( databaseMeta ) ) {
          it.remove();
        }
      }
    }
    return jobMeta;
  }
@Test
  public void filterPrivateDatabasesNullPrivateDatabaseTest() {
    IUnifiedRepository purMock = mock( IUnifiedRepository.class );
    JobMeta jobMeta = new JobMeta(  );
    jobMeta.setDatabases( getDummyDatabases() );
    jobMeta.setPrivateDatabases( null );
    StreamToJobNodeConverter jobConverter = new StreamToJobNodeConverter( purMock );
    assertEquals( jobMeta.getDatabases().size(), jobConverter.filterPrivateDatabases( jobMeta ).getDatabases().size() );
  }