package rx.broadcast.time;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.LongFunction;

public final class LamportClock implements Clock {
    private final Lock lock;

    private long time = -1L;

    public LamportClock() {
        this(new ReentrantLock());
    }

    public LamportClock(final Lock lock) {
        this.lock = lock;
    }

    public long time() {
        lock.lock();
        try {
            return time;
        } finally {
            lock.unlock();
        }
    }

    public void set(final long incoming) {
        lock.lock();
        try {
            if (Long.compareUnsigned(time, incoming) < 0) {
                time = incoming;
            }
        } finally {
            lock.unlock();
        }
    }

    public void tick() {
        lock.lock();
        try {
            time = time  + 1;
        } finally {
            lock.unlock();
        }
    }

    @Override
    public <T> T tick(final LongFunction<T> ticker) {
        lock.lock();
        try {
            time = time + 1;
            return ticker.apply(time);
        } finally {
            lock.unlock();
        }
    }
}

@@ -302,17 +302,24 @@
     this
-(
+.lock = 
 new Reen
@@ -333,85 +333,8 @@
 ck()
-);%0A    %7D%0A%0A    public LamportClock(final Lock lock) %7B%0A        this.lock = lock
 ;%0A  

Remove LamportClock override accepting a Lock instance