@Test
public void getDetailBinary(){

    Row[] rows =
        new Row[] {
            Row.of("prefix1", "{\"prefix1\": 0.9, \"prefix0\": 0.1}"),
            Row.of("prefix1", "{\"prefix1\": 0.8, \"prefix0\": 0.2}"),
            Row.of("prefix1", "{\"prefix1\": 0.7, \"prefix0\": 0.3}"),
            Row.of("prefix0", "{\"prefix1\": 0.75, \"prefix0\": 0.25}"),
            Row.of("prefix0", "{\"prefix1\": 0.6, \"prefix0\": 0.4}"),
            Row.of(null, "{\"prefix1\": 0.75, \"prefix0\": 0.25}"),
        };
    Object[] labels = new Object[]{"prefix1", "prefix0"};
    TypeInformation labelType = Types.STRING;
    Tuple3<Double, Boolean, Double> t = ClassificationEvaluationUtil.getBinaryDetailStatistics(rows[0], labels, labelType);
    Assert.assertEquals(t.f0, 0.9, 0.01);
    Assert.assertTrue(t.f1);
    t = ClassificationEvaluationUtil.getBinaryDetailStatistics(rows[4], labels, labelType);
    Assert.assertEquals(t.f0, 0.6, 0.01);
    Assert.assertFalse(t.f1);
    rows =
        new Row[] {
            Row.of(1.0, "{\"1.00\": 0.9, \"0.00\": 0.1}"),
            Row.of(1.00, "{\"1.0\": 0.8, \"0.00\": 0.2}"),
            Row.of(1.0, "{\"1.00\": 0.7, \"0.000\": 0.3}"),
            Row.of(0.0, "{\"1.0\": 0.75, \"0.0\": 0.25}"),
            Row.of(null, "{\"1.0\": 0.75, \"0.0\": 0.25}"),
            Row.of(0.00, "{\"1.0\": 0.6, \"0.00\": 0.4}")
        };
    labels = new Object[]{1.0, 0.0};
    labelType = Types.DOUBLE;
    t = ClassificationEvaluationUtil.getBinaryDetailStatistics(rows[1], labels, labelType);
    Assert.assertEquals(t.f0, 0.8, 0.01);
    Assert.assertTrue(t.f1);
    t = ClassificationEvaluationUtil.getBinaryDetailStatistics(rows[5], labels, labelType);
    Assert.assertEquals(t.f0, 0.6, 0.01);
    Assert.assertFalse(t.f1);
}