package com.mssngvwls;

import org.springframework.stereotype.Service;

@Service
public interface RandomNumberGenerator {

    public int between(final int lower, final int upper);
}

package com.mssngvwls;

import java.util.concurrent.ThreadLocalRandom;

import org.springframework.stereotype.Service;

@Service
public class RandomNumberGenerator {

    public int between(final int lower, final int upper) {
        return ThreadLocalRandom.current().nextInt(lower, upper + 1);
    }
}

Implement random number generator