@Test
public void testGetSimilarityMatrix() {

    Matrix M = new DenseMatrix(new double[][] {
        new double[] { 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 },
        new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0 },
        new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0 },
        new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
        new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 },
        new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0 },
        new double[] { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
        new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0 },
        new double[] { 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0 },
        new double[] { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
    });
    List<String> labels = Lists.newArrayListWithCapacity(M.numRows());
    for (int i = 0; i < M.numRows(); i++) {
        labels.add("L" + i);
    }
    LabeledMTJMatrix<String> M_l = LabeledMTJMatrix.of(M, labels);
    LabeledDenseMatrix<String> R = GraphPartition.getSimilarityMatrix(M_l);
    assertEquals(10, R.getMatrix().length);
    assertEquals(10, R.getMatrix()[0].length);
    assertEquals(10, R.getLabels().size());
}