public void addMapStatistics(DwrfProto.KeyInfo key, ColumnStatistics columnStatistics)
    {
        requireNonNull(key, "key is null");
        requireNonNull(columnStatistics, "columnStatistics is null");
        hasEntries = true;
        if (collectKeyStats) {
            entries.add(new MapStatisticsEntry(key, columnStatistics));
        }
    }
@Test(dataProvider = "keySupplier")
    public void testAddMapStatistics(KeyInfo[] keys)
    {
        KeyInfo key1 = keys[0];
        KeyInfo key2 = keys[1];

        ColumnStatistics columnStatistics1 = new ColumnStatistics(3L, null, null, null);
        ColumnStatistics columnStatistics2 = new ColumnStatistics(5L, null, null, null);

        MapColumnStatisticsBuilder builder = new MapColumnStatisticsBuilder(true);
        builder.addMapStatistics(key1, columnStatistics1);
        builder.addMapStatistics(key2, columnStatistics2);
        builder.increaseValueCount(10);

        MapColumnStatistics columnStatistics = (MapColumnStatistics) builder.buildColumnStatistics();
        assertEquals(columnStatistics.getNumberOfValues(), 10L);

        MapStatistics mapStatistics = columnStatistics.getMapStatistics();
        List<MapStatisticsEntry> entries = mapStatistics.getEntries();
        assertEquals(entries.size(), 2);
        assertEquals(entries.get(0).getKey(), key1);
        assertEquals(entries.get(0).getColumnStatistics(), columnStatistics1);
        assertEquals(entries.get(1).getKey(), key2);
        assertEquals(entries.get(1).getColumnStatistics(), columnStatistics2);
    }