The signature for timeToAvailable:

    def timeToAvailable(currentTime: Long, tokens: Int): Long


Doesn't say in which format the currentTime is, is it currentTimeMillis (similar name) or "currentNanoTime" which would hint at nanoTime