### Question:
UniqueColumnCombinationVisualization { protected UniqueColumnCombinationVisualizationData createVisualizationResult( UniqueColumnCombinationResult result) { List<Double> uniqueness = new LinkedList<>(); List<Double> distances = new LinkedList<>(); double columnCount = result.getColumnCombination().getColumnIdentifiers().size(); for (ColumnIdentifier column : result.getColumnCombination().getColumnIdentifiers()) { uniqueness.add(this.columnUniqueness.get(column.getColumnIdentifier())); } double sumUniqueness = 0; for (double d : uniqueness) { sumUniqueness += d; } double avgUniqueness = sumUniqueness / uniqueness.size(); Collections.sort(uniqueness); for (int i = 0; i < uniqueness.size() - 1; i++) { distances.add(i, uniqueness.get(i + 1) - uniqueness.get(i)); } Collections.sort(distances); return new UniqueColumnCombinationVisualizationData( result.getColumnCombination(), uniqueness.get(0), uniqueness.get(uniqueness.size() - 1), avgUniqueness, distances.get(0), distances.get(distances.size() - 1), distances.get(distances.size() / 2), columnCount, result.getRandomness()); } UniqueColumnCombinationVisualization(List<UniqueColumnCombinationResult> results,
                                              TableInformation tableInformation); void createVisualizationData(); @SuppressWarnings(Constants.SUPPRESS_WARNINGS_UNCHECKED) void printCluster(String filePath,
                           List<HashMap<String, Double>> clusters); @SuppressWarnings(Constants.SUPPRESS_WARNINGS_UNCHECKED) void printClusterData(String filePath,
                               List<List<UniqueColumnCombinationVisualizationData>> clusterData); @SuppressWarnings(Constants.SUPPRESS_WARNINGS_UNCHECKED) void printColumnCombinations(String filePath,
                                      List<List<HashMap<String, Double>>> clusters);  }### Answer:
@Test public void testCreateVisualizationResult() { UniqueColumnCombinationVisualization visualization = new UniqueColumnCombinationVisualization(results, tableInformation); UniqueColumnCombinationResult result = results.get(1); result.setRandomness(0.3f); UniqueColumnCombinationVisualizationData data = visualization.createVisualizationResult(result); assertEquals(result.getColumnCombination(), data.getColumnCombination()); assertEquals(0.5, data.getMinUniqueness(), 0.00); assertEquals(0.75, data.getMaxUniqueness(), 0.00); assertEquals(0.625, data.getAvgUniqueness(), 0.00); assertEquals(0.25, data.getMinDistance(), 0.00); assertEquals(0.25, data.getMaxDistance(), 0.00); assertEquals(0.25, data.getMedianDistance(), 0.00); assertEquals(2.0, data.getColumnCount(), 0.00); assertEquals(result.getRandomness(), data.getRandomness(), 0.00); }