presto-main/src/main/java/io/prestosql/operator/PipelineContext.java/PipelineContext/compareAndSet
class PipelineContext:    private static <K, V> boolean compareAndSet(ConcurrentMap<K, V> map, K key, V oldValue, V newValue)
    {
        if (oldValue == null) {
            return map.putIfAbsent(key, newValue) == null;
        }

        return map.replace(key, oldValue, newValue);
    }