@@ -0,0 +1,1838 @@
+/*%0A *      Copyright (C) 2015  higherfrequencytrading.com%0A *%0A *      This program is free software: you can redistribute it and/or modify%0A *      it under the terms of the GNU Lesser General Public License as published by%0A *      the Free Software Foundation, either version 3 of the License.%0A *%0A *      This program is distributed in the hope that it will be useful,%0A *      but WITHOUT ANY WARRANTY; without even the implied warranty of%0A *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A *      GNU Lesser General Public License for more details.%0A *%0A *      You should have received a copy of the GNU Lesser General Public License%0A *      along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0Apackage eg;%0A%0Aimport net.openhft.chronicle.map.ChronicleMap;%0Aimport net.openhft.chronicle.map.MapSegmentContext;%0Aimport org.junit.Test;%0A%0Aimport java.util.Arrays;%0Aimport java.util.LongSummaryStatistics;%0A%0Apublic class AverageValueSizeTest %7B%0A%0A    public static %3CV%3E double averageValueSize(Class%3CV%3E valueClass, Iterable%3CV%3E values) %7B%0A        ChronicleMap%3CInteger, V%3E testMap = ChronicleMap.of(Integer.class, valueClass)%0A                // doesn't matter, anyway not a single value will be written to a map%0A                .averageValueSize(1)%0A                .entries(1)%0A                .create();%0A        LongSummaryStatistics statistics = new LongSummaryStatistics();%0A        for (V value : values) %7B%0A            try (MapSegmentContext%3CInteger, V, ?%3E c = testMap.segmentContext(0)) %7B%0A                statistics.accept(c.wrapValueAsData(value).size());%0A            %7D%0A        %7D%0A        return statistics.getAverage();%0A    %7D%0A%0A    @Test%0A    public void averageValueSizeTest() %7B%0A        System.out.println(averageValueSize(String.class,%0A                Arrays.asList(%22banana%22, %22apple%22, %22watermelon%22)));%0A    %7D%0A%7D%0A

Add AverageValueSizeTest