@Override
    public final Integer generate(final Integer max) {
        final Integer result;

        if (max < LOWER_LIMIT) {
            LOGGER.warn(
                    "Received {} as maximum value, but this is lower than {}",
                    max, LOWER_LIMIT);
            result = 0;
        } else {
            result = random.nextInt(Math.abs(LOWER_LIMIT - max) + 1)
                    + LOWER_LIMIT;
        }

        return result;
    }
@ Override public final Integer generate ( final Integer max ) { final Integer result ; if ( max < LOWER_LIMIT ) { LOGGER . warn ( "Received {} as maximum value, but this is lower than {}" , max , LOWER_LIMIT ) ; result = 0 ; } else { result = random . nextInt ( Math . abs ( LOWER_LIMIT - max ) + 1 ) + LOWER_LIMIT ; } return result ; }
Generates a random value.
<p>
This value is in the interval [1,max].
<p>
TODO: Should be a protected method

@param max
the maximum value which can be generated
@return a random value in the interval [1,max]