@Test
public void updateAccurateBinaryMetricsSummaryTest() {

    long[] countValues = new long[] {0, 0, 3, 2};
    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}")
        };
    Object[] labels = new Object[] {"prefix1", "prefix0"};
    TypeInformation labelType = Types.STRING;
    AccurateBinaryMetricsSummary summary = new AccurateBinaryMetricsSummary(labels, 0.0, 0L, 0.);
    double[] tprFprPrecision = new double[ClassificationEvaluationUtil.RECORD_LEN];
    List<Tuple3<Double, Boolean, Double>> list = new ArrayList<>();
    for (Row row : rows) {
        list.add(ClassificationEvaluationUtil.getBinaryDetailStatistics(row, labels,
            labelType));
    }
    Collections.sort(list, Comparator.comparingDouble(t -> -t.f0));
    list.forEach(t -> ClassificationEvaluationUtil.updateAccurateBinaryMetricsSummary(t, summary, countValues,
        tprFprPrecision, true));
    BinaryClassMetrics summary1 = (BinaryClassMetrics)getDetailStatistics(Arrays.asList(rows), null, true, Types.STRING).toMetrics();
    BinaryClassMetrics summary2 = summary.toMetrics();
    Assert.assertEquals(summary1.getTotalSamples(), summary2.getTotalSamples());
    //Assert.assertEquals(summary1.getAuc(), summary2.getAuc());
    Assert.assertEquals(summary1.getKs(), summary2.getKs());
    Assert.assertEquals(summary1.getPrc(), summary2.getPrc());
    Assert.assertEquals(summary1.getGini(), summary2.getGini());
}