code: public LogicalTimestamp incrementAndUpdate(LogicalTimestamp timestamp) {
      long nextValue = currentTimestamp.value() + 1;
      if (timestamp.value() > nextValue) {
        return update(timestamp);
      }
      return increment();
    }
docs: Increments the clock and updates it using the given timestamp.
  
  @param timestamp the timestamp with which to update the clock
  @return the updated clock time