public final TypeV putIfMatch( Object key, Object newVal, Object oldVal ) {
    if (oldVal == null || newVal == null) throw new NullPointerException();
    final Object res = putIfMatch0(this, _kvs, key, newVal, oldVal );
    assert !(res instanceof Prime);
    assert res != null;
    return res == TOMBSTONE ? null : (TypeV)res;
  }
Atomically replace newVal for oldVal, returning the value that existed
 there before.  If the oldVal matches the returned value, then newVal was
 inserted, otherwise not.
 @return the previous value associated with the specified key,
        or <tt>null</tt> if there was no mapping for the key
 @throws NullPointerException if the key or either value is null
jctools-core/src/main/java/org/jctools/maps/NonBlockingHashMap.java