### Question:
LogicalClock implements Clock<LogicalTimestamp> { public LogicalClock() { this(new LogicalTimestamp(0)); } LogicalClock();  LogicalClock(LogicalTimestamp currentTimestamp); @Override LogicalTimestamp getTime(); LogicalTimestamp increment(); LogicalTimestamp update(LogicalTimestamp timestamp); LogicalTimestamp incrementAndUpdate(LogicalTimestamp timestamp); @Override String toString();  }### Answer:
@Test public void testLogicalClock() throws Exception { 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()); }