public V computeIfAbsent(K key, Function<? super K, ? extends V> valueFunction) {
        V value = cache.get(key);
        if (value == null) {
            if (cache.size() < capacity) {
                // use CHM.computeIfAbsent to avoid duplicate calculation of a single key
                value = cache.computeIfAbsent(key, valueFunction);
            } else {
                value = valueFunction.apply(key);
            }
        }
        return value;
    }
@Test
    public void when_addingElementsToCacheInSingleThread_then_properSizeAndElements() {
        int capacity = 20;
        int elementsToAdd = 100;
        ConcurrentInitialSetCache<Integer, Integer> cache = new ConcurrentInitialSetCache<>(capacity);
        for (int i = 0; i < elementsToAdd; i++) {
            cache.computeIfAbsent(i, Function.identity());
        }

        assertEquals(capacity, cache.cache.size());
        for (int i = 0; i < capacity; i++) {
            assertTrue(cache.cache.containsKey(i));
        }
    }