### Question:
VanillaSharedReplicatedHashMap extends AbstractVanillaSharedHashMap<K, V> implements SharedHashMap<K, V>, ReplicaExternalizable<K, V>, EntryResolver<K, V>,
        Closeable { @Override public V putIfAbsent(@net.openhft.lang.model.constraints.NotNull K key, V value) { return put0(key, value, false, localIdentifier, timeProvider.currentTimeMillis()); } VanillaSharedReplicatedHashMap(@NotNull SharedHashMapBuilder builder,
                                          @NotNull Class<K> kClass,
                                          @NotNull Class<V> vClass); @Override long lastModificationTime(byte remoteIdentifier); @Override V put(K key, V value); @Override V putIfAbsent(@net.openhft.lang.model.constraints.NotNull K key, V value); @Override V remove(final Object key); @Override void close(); @Override byte identifier(); @Override Replica.ModificationIterator acquireModificationIterator(short remoteIdentifier,
             @NotNull final ModificationNotifier modificationNotifier); @Override boolean remove(@net.openhft.lang.model.constraints.NotNull final Object key, final Object value); @Override void writeExternalEntry(@NotNull AbstractBytes entry, @NotNull Bytes destination, int chronicleId); @Override void readExternalEntry(@NotNull Bytes source); @NotNull @Override Set<Entry<K, V>> entrySet(); @Override K key(@NotNull AbstractBytes entry, K usingKey); @Override V value(@NotNull AbstractBytes entry, V usingValue); @Override boolean wasRemoved(@NotNull AbstractBytes entry); static final int RESERVED_MOD_ITER; }### Answer:
@Test public void testPutIfAbsent() throws IOException { SharedHashMap map = map5(); map.putIfAbsent(JSR166TestCase.six, "Z"); assertTrue(map.containsKey(JSR166TestCase.six)); }
@Test public void testPutIfAbsent2() throws IOException { SharedHashMap map = map5(); final Object z = map.putIfAbsent(JSR166TestCase.one, "Z"); assertEquals("A", z); }
@Test public void testPutIfAbsent1_NullPointerException() throws IOException { try { SharedHashMap c = newShmIntString(5); c.putIfAbsent(null, "whatever"); shouldThrow(); } catch (NullPointerException success) { } }
@Test public void testPutIfAbsent2_NullPointerException() throws IOException { try { SharedHashMap c = newShmIntString(5); c.putIfAbsent(JSR166TestCase.notPresent, null); shouldThrow(); } catch (NullPointerException success) { } }