@SuppressWarnings({"unchecked", "rawtypes"})
    public Collection<DataNode> getDataNodes(final String tableName) {
        Collection<DataNode> result = getDataNodesByTableName(tableName);
        if (result.isEmpty()) {
            return result;
        }
        for (Entry<ShardingSphereRule, DataNodeBuilder> entry : dataNodeBuilders.entrySet()) {
            result = entry.getValue().build(result, entry.getKey());
        }
        return result;
    }
@Test
    void assertGetDataNodesForShardingTableWithDataNodeContainedRuleAndDataSourceContainedRule() {
        DataNodes dataNodes = new DataNodes(mockShardingSphereRules());
        Collection<DataNode> actual = dataNodes.getDataNodes("t_order");
        assertThat(actual.size(), is(6));
        Iterator<DataNode> iterator = actual.iterator();
        DataNode firstDataNode = iterator.next();
        assertThat(firstDataNode.getDataSourceName(), is("primary_ds"));
        assertThat(firstDataNode.getTableName(), is("t_order_0"));
        DataNode secondDataNode = iterator.next();
        assertThat(secondDataNode.getDataSourceName(), is("replica_ds_0"));
        assertThat(secondDataNode.getTableName(), is("t_order_0"));
        DataNode thirdDataNode = iterator.next();
        assertThat(thirdDataNode.getDataSourceName(), is("replica_ds_1"));
        assertThat(thirdDataNode.getTableName(), is("t_order_0"));
        DataNode fourthDataNode = iterator.next();
        assertThat(fourthDataNode.getDataSourceName(), is("primary_ds"));
        assertThat(fourthDataNode.getTableName(), is("t_order_1"));
        DataNode fifthDataNode = iterator.next();
        assertThat(fifthDataNode.getDataSourceName(), is("replica_ds_0"));
        assertThat(fifthDataNode.getTableName(), is("t_order_1"));
        DataNode sixthDataNode = iterator.next();
        assertThat(sixthDataNode.getDataSourceName(), is("replica_ds_1"));
        assertThat(sixthDataNode.getTableName(), is("t_order_1"));
    }