### Question:
UniqueColumnCombinationRanking extends Ranking { protected void calculateRandomness(UniqueColumnCombinationResult result) { TableInformation table = this.tableInformationMap.get(result.getTableName()); Map<String, ColumnInformation> columnInformationMap = table.getColumnInformationMap(); Set<ColumnIdentifier> columns = result.getColumnCombination().getColumnIdentifiers(); long min = table.getRowCount(); long max = (min - 1) ^ columns.size(); float distinctValue = 1; for (ColumnIdentifier column : columns) { distinctValue = distinctValue * columnInformationMap.get(column.getColumnIdentifier()) .getDistinctValuesCount(); } float randomness = (distinctValue - min) / (max - min); result.setRandomness(randomness); } UniqueColumnCombinationRanking(List<UniqueColumnCombinationResult> results,
                                        Map<String, TableInformation> tableInformationMap); @Override void calculateDataIndependentRankings(); @Override void calculateDataDependentRankings();  }### Answer:
@Test public void testCalculateRandomness() throws Exception { UniqueColumnCombinationRanking ranking = new UniqueColumnCombinationRanking( uniqueColumnCombinationResults, tableInformationMap); UniqueColumnCombinationResult result = uniqueColumnCombinationResults.get(1); ranking.calculateRandomness(result); assertEquals(-0.66, result.getRandomness(), 0.01); result = uniqueColumnCombinationResults.get(0); ranking.calculateRandomness(result); assertEquals(0.0, result.getRandomness(), 0.00); }