public V put(K key, V value) {
    return resolve(map.put(key, new WeakReference<>(value)));
  }
@Test
  public void testDemandCreateEntries() {

    // ask for an unknown key and expect a generated value
    assertMapEntryEquals(1, factory(1));
    assertMapSize(1);
    assertMapContainsKey(1);
    assertLostCount(0);

    // an empty ref has the same outcome
    referenceMap.put(2, null);
    assertMapEntryEquals(2, factory(2));
    // but the lost coun goes up
    assertLostCount(1);

  }