Set<String> getAllDatabases(@Nullable String filter) throws TException {
    if (filter == null || filter.isEmpty()) {
      return new HashSet<>(client.get_all_databases());
    }
    return client.get_all_databases()
        .stream()
        .filter(n -> n.matches(filter))
        .collect(Collectors.toSet());
  }
@Test
  public void getAllDatabases() throws Exception {
    Set<String> databases = client.getAllDatabases(null);
    MatcherAssert.assertThat(databases, Matchers.hasItem("default"));
    MatcherAssert.assertThat(databases, Matchers.hasItem(TEST_DATABASE.toLowerCase()));
    assertThat(client.getAllDatabases(TEST_DATABASE.toLowerCase()), Matchers.contains(TEST_DATABASE.toLowerCase()));
  }