@VisibleForTesting
  @CheckForNull
  CharsetHandler getHandler(Dialect dialect) {
    switch (dialect.getId()) {
      case H2.ID:
        // nothing to check
        return null;
      case Oracle.ID:
        return new OracleCharsetHandler(sqlExecutor);
      case PostgreSql.ID:
        return new PostgresCharsetHandler(sqlExecutor, new PostgresMetadataReader(sqlExecutor));
      case MsSql.ID:
        return new MssqlCharsetHandler(sqlExecutor, new MssqlMetadataReader(sqlExecutor));
      default:
        throw new IllegalArgumentException("Database not supported: " + dialect.getId());
    }
  }
@Test
  public void getHandler_throws_IAE_if_unsupported_db() {
    Dialect unsupportedDialect = mock(Dialect.class);
    when(unsupportedDialect.getId()).thenReturn("foo");

    assertThatThrownBy(() -> underTest.getHandler(unsupportedDialect))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Database not supported: foo");
  }