@Test public void simpleItem() { SimpleItem<Integer> item = new SimpleItem<Integer>(10); assertEquals(10, item.getValue().intValue()); assertEquals(0, item.getVersion()); SimpleItem<Integer> item2 = new SimpleItem<>(2, 10); assertEquals(2, item2.getVersion()); assertEquals(10, item2.getValue().intValue()); assertEquals(item2.getVersion() + 1, item2.update(3).getVersion()); assertFalse(item2.equals(item2.update(4))); item.hashCode(); item.toString(); }
public SimpleItem(final V value) { this.value = value; this.version = 0; }
SimpleItem implements VersionedItem<V> { public SimpleItem(final V value) { this.value = value; this.version = 0; } }
SimpleItem implements VersionedItem<V> { public SimpleItem(final V value) { this.value = value; this.version = 0; } SimpleItem(final V value);  SimpleItem(final int version, final V value); }
SimpleItem implements VersionedItem<V> { public SimpleItem(final V value) { this.value = value; this.version = 0; } SimpleItem(final V value);  SimpleItem(final int version, final V value); V getValue(); @Override VersionedItem<V> update(V newValue); int getVersion(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
SimpleItem implements VersionedItem<V> { public SimpleItem(final V value) { this.value = value; this.version = 0; } SimpleItem(final V value);  SimpleItem(final int version, final V value); V getValue(); @Override VersionedItem<V> update(V newValue); int getVersion(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }