TableRule { public Collection<String> getActualTableNames(final String targetDataSource) { return datasourceToTablesMap.getOrDefault(targetDataSource, Collections.emptySet()); } TableRule(final Collection<String> dataSourceNames, final String logicTableName);  TableRule(final ShardingTableRuleConfiguration tableRuleConfig, final Collection<String> dataSourceNames, 
                     final ShardingAlgorithm databaseShardingAlgorithm, final ShardingAlgorithm tableShardingAlgorithm, final String defaultGenerateKeyColumn);  TableRule(final ShardingAutoTableRuleConfiguration tableRuleConfig, 
                     final Collection<String> dataSourceNames, final ShardingAlgorithm shardingAlgorithm, final String defaultGenerateKeyColumn); Map<String, List<DataNode>> getDataNodeGroups(); Collection<String> getActualDatasourceNames(); Collection<String> getActualTableNames(final String targetDataSource); Optional<String> getGenerateKeyColumn();  }
@Test public void assertGetActualTableNames() { TableRule actual = new TableRule(new ShardingTableRuleConfiguration("LOGIC_TABLE", "ds${0..1}.table_${0..2}"), Arrays.asList("ds0", "ds1"), null, null, null); assertThat(actual.getActualTableNames("ds0"), is(Sets.newLinkedHashSet(Arrays.asList("table_0", "table_1", "table_2")))); assertThat(actual.getActualTableNames("ds1"), is(Sets.newLinkedHashSet(Arrays.asList("table_0", "table_1", "table_2")))); assertThat(actual.getActualTableNames("ds2"), is(Collections.emptySet())); }