code: public long next() {
  
      long currentTime = System.currentTimeMillis();
      long counter;
  
      synchronized(this) {
  
        if (currentTime < referenceTime) {
          throw new RuntimeException(String.format("Last referenceTime %s is after reference time %s", referenceTime, currentTime));
        } else if (currentTime > referenceTime) {
          this.sequence = 0;
        } else {
          if (this.sequence < Snowflake.MAX_SEQUENCE) {
            this.sequence++;
          } else {
            throw new RuntimeException("Sequence exhausted at " + this.sequence);
          }
        }
        counter = this.sequence;
        referenceTime = currentTime;
      }
  
      return currentTime << NODE_SHIFT << SEQ_SHIFT | node << SEQ_SHIFT | counter;
    }
docs: Generates a k-ordered unique 64-bit integer. Subsequent invocations of this method will produce
  increasing integer values.
  
  @return The next 64-bit integer.