### Question:
BindingTableRule { public String getBindingActualTable(final String dataSource, final String logicTable, final String otherActualTable) { int index = -1; for (TableRule each : tableRules) { if (each.isDynamic()) { throw new UnsupportedOperationException("Dynamic table cannot support Binding table."); } index = each.findActualTableIndex(dataSource, otherActualTable); if (-1 != index) { break; } } Preconditions.checkState(-1 != index, String.format("Actual table [%s].[%s] is not in table config", dataSource, otherActualTable)); for (TableRule each : tableRules) { if (each.getLogicTable().equalsIgnoreCase(logicTable)) { return each.getActualTables().get(index).getTableName(); } } throw new IllegalStateException(String.format("Cannot find binding actual table, data source: %s, logic table: %s, other actual table: %s", dataSource, logicTable, otherActualTable)); }  boolean hasLogicTable(final String logicTableName); String getBindingActualTable(final String dataSource, final String logicTable, final String otherActualTable);  }### Answer:
@Test public void assertGetBindingActualTablesSuccess() { assertThat(createBindingTableRule().getBindingActualTable("ds1", "subLogicTable", "table_1"), is("sub_table_1")); }
@Test(expected = IllegalStateException.class) public void assertGetBindingActualTablesFailureWhenNotFound() { createBindingTableRule().getBindingActualTable("no_ds", "subLogicTable", "table_1"); }
@Test(expected = UnsupportedOperationException.class) public void assertGetBindingActualTablesFailureWhenIsDynamicTable() { createDynamicBindingTableRule().getBindingActualTable("no_ds", "subLogicTable", "table_1"); }