public class AgglomerativeClusteringTest {
@Test
public void testClustering() {
ArrayList<DoubleVector> vecs = new ArrayList<>();
vecs.add(new DenseDoubleVector(new double[] { 0, 5 }));
vecs.add(new DenseDoubleVector(new double[] { 0, 6 }));
vecs.add(new DenseDoubleVector(new double[] { 6, 5 }));
vecs.add(new DenseDoubleVector(new double[] { 6, 6 }));
vecs.add(new DenseDoubleVector(new double[] { 10, 10 }));
vecs.add(new DenseDoubleVector(new double[] { 5, 0 }));
HashMultimap<Integer, double[]> result = HashMultimap.create();
result.put(0, new double[] { 5.25, 5.25 });
result.put(1, new double[] { 3.0, 5.5 });
result.put(1, new double[] { 7.5, 5.0 });