class ExponentialBackoffTimeoutStrategy implements TimeoutStrategy {

    @Override public long nextTimeout(long timeout) throws IgniteSpiOperationTimeoutException {
        long remainingTime = remainingTime(System.nanoTime());

        if (remainingTime <= 0)
            throw new IgniteSpiOperationTimeoutException("Operation timed out [timeoutStrategy= " + this + "]");

        /*
            If timeout is zero that means we need return current verified timeout and calculate next timeout.
            In case of non zero we just reverify previously calculated value not to breach totalTimeout.
         */
        if (timeout == 0) {
            long prevTimeout = currTimeout;

            currTimeout = backoffTimeout(currTimeout, maxTimeout);

            return Math.min(prevTimeout, remainingTime);
        } else
            return Math.min(timeout, remainingTime);
    }

    public  ExponentialBackoffTimeoutStrategy(
        long totalTimeout,
        long startTimeout,
        long maxTimeout
    );

}