package com.atlassian.bitbucket.mesh.clock;

import java.time.*;

public class TickingClock extends Clock {

    private Instant instant;

    public TickingClock() {
        this.instant = Instant.now();
    }

    @Override
    public ZoneId getZone() {
        return ZoneOffset.UTC;
    }

    @Override
    public Instant instant() {
        return instant;
    }

    public void tick(Duration duration) {
        instant = instant.plus(duration);
    }

    @Override
    public Clock withZone(ZoneId zone) {
        throw new UnsupportedOperationException("withZone not implemented");
    }
}
