@VisibleForTesting
  TransMeta filterPrivateDatabases( TransMeta transMeta ) {
    Set<String> privateDatabases = transMeta.getPrivateDatabases();
    if ( privateDatabases != null ) {
      // keep only private transformation databases
      for ( Iterator<DatabaseMeta> it = transMeta.getDatabases().iterator(); it.hasNext(); ) {
        DatabaseMeta databaseMeta = it.next();
        String databaseName = databaseMeta.getName();
        if ( !privateDatabases.contains( databaseName ) && !transMeta.isDatabaseConnectionUsed( databaseMeta ) ) {
          it.remove();
        }
      }
    }
    return transMeta;
  }
@Test
  public void filterPrivateDatabasesWithOnePrivateDatabaseTest() {
    IUnifiedRepository purMock = mock( IUnifiedRepository.class );
    TransMeta transMeta = new TransMeta(  );
    transMeta.setDatabases( getDummyDatabases() );
    Set<String> privateDatabases = new HashSet<>(  );
    privateDatabases.add( "database2" );
    transMeta.setPrivateDatabases( privateDatabases );
    StreamToTransNodeConverter transConverter = new StreamToTransNodeConverter( purMock );
    assertEquals( 1, transConverter.filterPrivateDatabases( transMeta ).getDatabases().size() );
  }