@Override public E intern(E sample) {
    E canonical = map.get(sample);
    if (canonical != null) {
      return canonical;
    }

    var value = map.putIfAbsent(sample, sample);
    return (value == null) ? sample : value;
  }
@Test
  public void intern_weak_remove() {
    var canonical = new Int(1);
    var next = new Int(2);

    Interner<Int> interner = Interner.newWeakInterner();
    assertThat(interner.intern(canonical)).isSameInstanceAs(canonical);

    var signal = new WeakReference<>(canonical);
    canonical = null;

    GcFinalization.awaitClear(signal);
    assertThat(interner.intern(next)).isSameInstanceAs(next);
    checkSize(interner, 1);
    checkState(interner);
  }