public void incrementAll(CounterMap<F, S> other) {
        for (Map.Entry<F, Counter<S>> entry : other.maps.entrySet()) {
            F key = entry.getKey();
            Counter<S> innerCounter = entry.getValue();
            for (Map.Entry<S, AtomicDouble> innerEntry : innerCounter.entrySet()) {
                S value = innerEntry.getKey();
                incrementCount(key, value, innerEntry.getValue().get());
            }
        }
    }
@Test
    public void testIncrementAll() {
        CounterMap<Integer, Integer> counterMapA = new CounterMap<>();

        counterMapA.incrementCount(0, 0, 1);
        counterMapA.incrementCount(0, 1, 1);
        counterMapA.incrementCount(0, 2, 1);
        counterMapA.incrementCount(1, 0, 1);
        counterMapA.incrementCount(1, 1, 1);
        counterMapA.incrementCount(1, 2, 1);

        CounterMap<Integer, Integer> counterMapB = new CounterMap<>();

        counterMapB.incrementCount(1, 1, 1);
        counterMapB.incrementCount(2, 1, 1);

        counterMapA.incrementAll(counterMapB);

        assertEquals(2.0, counterMapA.getCount(1,1), 1e-5);
        assertEquals(1.0, counterMapA.getCount(2,1), 1e-5);
        assertEquals(1.0, counterMapA.getCount(0,0), 1e-5);


        assertEquals(7, counterMapA.totalSize());


        counterMapA.setCount(2, 1, 17);

        assertEquals(17.0, counterMapA.getCount(2, 1), 1e-5);
    }