class LimitChecker {

    public static long INFINITY_DURATION = Long.MAX_VALUE;
    public static long UNLIMITED_AMOUNT = Long.MAX_VALUE;

    public static void checkTokensToAdd(long tokensToAdd) {<FILL_FUNCTION_BODY>}

    public static void checkTokensToConsume(long tokensToConsume) {
        if (tokensToConsume <= 0) {
            throw BucketExceptions.nonPositiveTokensToConsume(tokensToConsume);
        }
    }

    public static void checkMaxWaitTime(long maxWaitTimeNanos) {
        if (maxWaitTimeNanos <= 0) {
            throw BucketExceptions.nonPositiveNanosToWait(maxWaitTimeNanos);
        }
    }

    public static void checkScheduler(ScheduledExecutorService scheduler) {
        if (scheduler == null) {
            throw BucketExceptions.nullScheduler();
        }
    }

    public static void checkConfiguration(BucketConfiguration newConfiguration) {
        if (newConfiguration == null) {
            throw BucketExceptions.nullConfiguration();
        }
    }

    public static void checkMigrationMode(TokensInheritanceStrategy tokensInheritanceStrategy) {
        if (tokensInheritanceStrategy == null) {
            throw BucketExceptions.nullTokensInheritanceStrategy();
        }
    }

}

        if (tokensToAdd <= 0) {
            throw new IllegalArgumentException("tokensToAdd should be >= 0");
        }
    
<no_super_class>