public String[] checkParameters() {
    ArrayList<String> remarks = new ArrayList<>();

    if ( getDatabaseInterface() == null ) {
      remarks.add( BaseMessages.getString( PKG, "DatabaseMeta.BadInterface" ) );
    }

    if ( getName() == null || getName().length() == 0 ) {
      remarks.add( BaseMessages.getString( PKG, "DatabaseMeta.BadConnectionName" ) );
    }

    if ( !isPartitioned()
      && ( ( (BaseDatabaseMeta) getDatabaseInterface() ).requiresName()
      && !( getDatabaseInterface() instanceof GenericDatabaseMeta ) ) ) {
      if ( getDatabaseName() == null || getDatabaseName().length() == 0 ) {
        remarks.add( BaseMessages.getString( PKG, "DatabaseMeta.BadDatabaseName" ) );
      }
    }

    return remarks.toArray( new String[ remarks.size() ] );
  }
@Test
  public void testCheckParameters() {
    DatabaseMeta meta = mock( DatabaseMeta.class );
    BaseDatabaseMeta databaseInterface = mock( BaseDatabaseMeta.class );
    when( databaseInterface.requiresName() ).thenReturn( true );
    when( meta.getDatabaseInterface() ).thenReturn( databaseInterface );
    when( meta.getName() ).thenReturn( null );
    when( meta.isPartitioned() ).thenReturn( false );
    when( meta.checkParameters() ).thenCallRealMethod();
    assertEquals( 2, meta.checkParameters().length );
  }