@Nullable public V putIfProbablyAbsent(K key, V value) {
    if (key == null) throw new NullPointerException("key == null");
    if (value == null) throw new NullPointerException("value == null");
    expungeStaleEntries();

    return target.putIfAbsent(new WeakKey<K>(key, this), value);
  }
@Test void getOrCreate_whenSomeReferencesAreCleared() {
    map.putIfProbablyAbsent(key, "1");
    pretendGCHappened();
    map.putIfProbablyAbsent(key, "1");

    // we'd expect two distinct entries..
    assertThat(map.target.keySet())
      .extracting(WeakReference::get)
      .containsExactlyInAnyOrder(null, key);
  }