TableMetaDataManager { String computeTableName(RegionMapping regionMapping) { String result = regionMapping.getTableName(); if (result == null) { result = regionMapping.getRegionName(); } return result; }  TableMetaDataView getTableMetaDataView(Connection connection,
      RegionMapping regionMapping);  }
@Test public void computeTableNameGivenRegionMappingTableNameReturnsIt() { when(regionMapping.getTableName()).thenReturn("myTableName"); String result = tableMetaDataManager.computeTableName(regionMapping); assertThat(result).isEqualTo("myTableName"); }
@Test public void computeTableNameGivenRegionMappingRegionNameReturnsItIfTableNameIsNull() { when(regionMapping.getTableName()).thenReturn(null); when(regionMapping.getRegionName()).thenReturn("myRegionName"); String result = tableMetaDataManager.computeTableName(regionMapping); assertThat(result).isEqualTo("myRegionName"); }