@Test
public void reduceBinaryPartitionSummaryTest(){

    List<ClassificationEvaluationUtil.BinaryPartitionSummary> list = new ArrayList<>();
    ClassificationEvaluationUtil.BinaryPartitionSummary summary1 = new ClassificationEvaluationUtil
        .BinaryPartitionSummary(0, 0.9, 5, 3);
    list.add(summary1);
    ClassificationEvaluationUtil.BinaryPartitionSummary summary2 = new ClassificationEvaluationUtil
        .BinaryPartitionSummary(1, 0.7, 4, 1);
    list.add(summary2);
    ClassificationEvaluationUtil.BinaryPartitionSummary summary3 = new ClassificationEvaluationUtil
        .BinaryPartitionSummary(2, 0.4, 3, 6);
    list.add(summary3);
    Tuple2<Boolean, long[]> t = ClassificationEvaluationUtil.reduceBinaryPartitionSummary(list, 0);
    Assert.assertTrue(t.f0);
    Assert.assertArrayEquals(t.f1, new long[]{0, 0, 12, 10});
    t = ClassificationEvaluationUtil.reduceBinaryPartitionSummary(list, 2);
    Assert.assertFalse(t.f0);
    Assert.assertArrayEquals(t.f1, new long[]{9, 4, 12, 10});
}