@@ -0,0 +1,851 @@
+package com.winterbe.java8.samples.concurrent;%0A%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.atomic.LongAccumulator;%0Aimport java.util.stream.IntStream;%0A%0A/**%0A * @author Benjamin Winterberg%0A */%0Apublic class LongAccumulator1 %7B%0A%0A    private static final int SIZE = 10;%0A%0A    private static LongAccumulator accumulator = new LongAccumulator((x, y) -%3E 2 * x + y, 1L);%0A%0A    public static void main(String%5B%5D args) %7B%0A        testAccumulate();%0A    %7D%0A%0A    private static void testAccumulate() %7B%0A        ExecutorService executor = Executors.newFixedThreadPool(2);%0A%0A        IntStream.range(0, SIZE)%0A                .forEach(i -%3E executor.submit(() -%3E accumulator.accumulate(i)));%0A%0A        ConcurrentUtils.stop(executor);%0A%0A        System.out.format(%22Add: %25d%5Cn%22, accumulator.getThenReset());%0A    %7D%0A%7D%0A

Add LongAccumulator example