### Question:
ShardingRule { public Collection<String> filterAllBindingTables(final Collection<String> logicTables) { if (logicTables.isEmpty()) { return Collections.emptyList(); } Optional<BindingTableRule> bindingTableRule = findBindingTableRule(logicTables); if (!bindingTableRule.isPresent()) { return Collections.emptyList(); } Collection<String> result = new ArrayList<>(bindingTableRule.get().getAllLogicTables()); result.retainAll(logicTables); return result; } @Deprecated  ShardingRule(
            final DataSourceRule dataSourceRule, final Collection<TableRule> tableRules, final Collection<BindingTableRule> bindingTableRules, 
            final DatabaseShardingStrategy databaseShardingStrategy, final TableShardingStrategy tableShardingStrategy, final KeyGenerator keyGenerator); static ShardingRuleBuilder builder(); Optional<TableRule> tryFindTableRule(final String logicTableName); TableRule getTableRule(final String logicTableName); DatabaseShardingStrategy getDatabaseShardingStrategy(final TableRule tableRule); TableShardingStrategy getTableShardingStrategy(final TableRule tableRule); boolean isAllBindingTables(final Collection<String> logicTables); Collection<String> filterAllBindingTables(final Collection<String> logicTables); Optional<BindingTableRule> findBindingTableRule(final String logicTable); boolean isShardingColumn(final Column column); Optional<String> getGenerateKeyColumn(final String tableName); Number generateKey(final String tableName);  }### Answer:
@Test public void assertFilterAllBindingTablesWhenLogicTablesIsEmpty() { assertThat(createShardingRule().filterAllBindingTables(Collections.<String>emptyList()), is((Collection<String>) Collections.<String>emptyList())); }
@Test public void assertFilterAllBindingTablesWhenBindingTableRuleIsNotFound() { assertThat(createShardingRule().filterAllBindingTables(Collections.singletonList("newTable")), is((Collection<String>) Collections.<String>emptyList())); }
@Test public void assertFilterAllBindingTables() { assertThat(createShardingRule().filterAllBindingTables(Collections.singletonList("logicTable")), is((Collection<String>) Collections.singletonList("logicTable"))); assertThat(createShardingRule().filterAllBindingTables(Collections.singletonList("subLogicTable")), is((Collection<String>) Collections.singletonList("subLogicTable"))); assertThat(createShardingRule().filterAllBindingTables(Arrays.asList("logicTable", "subLogicTable")), is((Collection<String>) Arrays.asList("logicTable", "subLogicTable"))); assertThat(createShardingRule().filterAllBindingTables(Arrays.asList("logicTable", "newTable", "subLogicTable")), is((Collection<String>) Arrays.asList("logicTable", "subLogicTable"))); }