@Override
    public V put(K key, V value) {
        Objects.requireNonNull(key);
        Objects.requireNonNull(value);
        TimelineHashMapEntry<K, V> entry = new TimelineHashMapEntry<>(key, value);
        TimelineHashMapEntry<K, V> prev = snapshottableAddOrReplace(entry);
        if (prev == null) {
            return null;
        }
        return prev.getValue();
    }
@Test
    public void testNullsForbidden() {
        SnapshotRegistry registry = new SnapshotRegistry(new LogContext());
        TimelineHashMap<String, Boolean> map = new TimelineHashMap<>(registry, 1);
        assertThrows(NullPointerException.class, () -> map.put(null, true));
        assertThrows(NullPointerException.class, () -> map.put("abc", null));
        assertThrows(NullPointerException.class, () -> map.put(null, null));
    }