/*
 * This file is part of memoization.java. It is subject to the license terms in the LICENSE file found in the top-level
 * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of memoization.java,
 * including this file, may be copied, modified, propagated, or distributed except according to the terms contained
 * in the LICENSE file.
 */
package de.xn__ho_hia.memoization.map;

import static java.util.Objects.requireNonNull;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

class ConcurrentHashMapBasedMemoizer<KEY, VALUE> {

    private final Map<KEY, VALUE> cache;

    @SuppressWarnings("nls")
    ConcurrentHashMapBasedMemoizer(final Map<KEY, VALUE> preComputedValues) {
        this.cache = new ConcurrentHashMap<>(requireNonNull(preComputedValues,
                "Provide an empty map instead of NULL in case you don't have any precomputed values."));
    }

    protected final VALUE computeIfAbsent(final KEY key, final Function<KEY, VALUE> mappingFunction) {
        return cache.computeIfAbsent(key, mappingFunction);
    }

    final Map<KEY, VALUE> viewCacheForTest() {
        return Collections.unmodifiableMap(cache);
    }

}

@@ -606,16 +606,85 @@
 ction;%0A%0A
+import de.xn__ho_hia.quality.suppression.CompilerWarnings;%0A%0Aabstract 
 class Co
@@ -795,18 +795,43 @@
 ngs(
-%22nls%22)%0A   
+CompilerWarnings.NLS)%0A    protected
  Con

mark abstract class as abstract