presto-hive/src/main/java/io/prestosql/plugin/hive/HiveSplitSource.java/HiveSplitSource/setIf
class HiveSplitSource:    private static <T> boolean setIf(AtomicReference<T> atomicReference, T newValue, Predicate<T> predicate)
    {
        while (true) {
            T current = atomicReference.get();
            if (!predicate.test(current)) {
                return false;
            }
            if (atomicReference.compareAndSet(current, newValue)) {
                return true;
            }
        }
    }