LogicalClock implements Clock<LogicalTimestamp> { public LogicalClock() { this(new LogicalTimestamp(0)); } LogicalClock();  LogicalClock(final LogicalTimestamp currentTimestamp); @Override LogicalTimestamp getTime(); LogicalTimestamp increment(); LogicalTimestamp update(final LogicalTimestamp timestamp); LogicalTimestamp incrementAndUpdate(final LogicalTimestamp timestamp); @Override String toString();  }
@Test public void testLogicalClock() throws Exception { final LogicalClock clock = new LogicalClock(); assertEquals(1, clock.increment().value()); assertEquals(1, clock.getTime().value()); assertEquals(2, clock.increment().value()); assertEquals(2, clock.getTime().value()); assertEquals(5, clock.update(LogicalTimestamp.of(5)).value()); assertEquals(5, clock.getTime().value()); assertEquals(5, clock.update(LogicalTimestamp.of(3)).value()); }