@Test
public void testGetMentionMatrix() {

    List<EmojiEntity> mentions = Lists.newArrayListWithCapacity(16);
    // make r1, r2 and r2 kind of similar
    mentions.add(new EmojiEntity("u1", "r1", DateTime.now(), "a", 1, false));
    mentions.add(new EmojiEntity("u1", "r2", DateTime.now(), "a", 1, false));
    mentions.add(new EmojiEntity("u1", "r3", DateTime.now(), "a", 1, false));
    mentions.add(new EmojiEntity("u1", "r1", DateTime.now(), "b", 1, false));
    mentions.add(new EmojiEntity("u1", "r2", DateTime.now(), "b", 1, false));
    mentions.add(new EmojiEntity("u1", "r2", DateTime.now(), "c", 1, false));
    mentions.add(new EmojiEntity("u1", "r3", DateTime.now(), "c", 1, false));
    LabeledMTJMatrix<String> result =
            GraphPartition.getMentionMatrix(mentions,
                                            mention -> mention.getRoomName(),
                                            mention -> mention.getValue());
    // there's three rooms so we expect the size of the matrix to be 3x3 with 3 labels
    assertEquals(3, result.getMatrix().numRows());
    assertEquals(3, result.getMatrix().numColumns());
    assertEquals(3, result.getLabels().stream().distinct().count());
}