### Question:
KMeansUtils { public static void checkUniqueIDs(Collection<ClusterInfo> clusters) { Preconditions.checkArgument(clusters.stream().map(ClusterInfo::getID).distinct().count() == clusters.size()); } private  KMeansUtils(); static Pair<ClusterInfo,Double> closestCluster(List<ClusterInfo> clusters,
                                                        DistanceFn<double[]> distanceFn,
                                                        double[] vector); static double[] featuresFromTokens(String[] data, InputSchema inputSchema); static void checkUniqueIDs(Collection<ClusterInfo> clusters);  }### Answer:
@Test public void testUniqueIDs() { KMeansUtils.checkUniqueIDs(Arrays.asList( new ClusterInfo(2, new double[] { 1.0 }, 1), new ClusterInfo(4, new double[] { 0.0 }, 1), new ClusterInfo(1, new double[] { 3.0 }, 1) )); }
@Test(expected = IllegalArgumentException.class) public void testNonUniqueIDs() { KMeansUtils.checkUniqueIDs(Arrays.asList( new ClusterInfo(2, new double[] { 1.0 }, 1), new ClusterInfo(4, new double[] { 0.0 }, 1), new ClusterInfo(2, new double[] { 3.0 }, 1) )); }