public void update(Integer key, T value) { delegate.update(key, value); }
@Test public void canUpdateForNewKeys() throws InterruptedException { assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION + 1L)); supplier.update(1, 1L); waitForUpdate(); assertThat(supplier.get()).isEqualTo(VersionedType.of(1L, UNINITIALIZED_VERSION + 2L)); supplier.update(2, 100L); waitForUpdate(); assertThat(supplier.get()).isEqualTo(VersionedType.of(100L, UNINITIALIZED_VERSION + 3L)); }
@Test public void canUpdateForExistingKeys() throws InterruptedException { assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION + 1L)); supplier.update(2, 100L); waitForUpdate(); assertThat(supplier.get()).isEqualTo(VersionedType.of(100L, UNINITIALIZED_VERSION + 2L)); supplier.update(2, 10L); waitForUpdate(); assertThat(supplier.get()).isEqualTo(VersionedType.of(10L, UNINITIALIZED_VERSION + 3L)); }
public void update(Integer key, T value) { delegate.update(key, value); }