if (Double.isInfinite(upper)) {
throw new NotFiniteNumberException(LocalizedFormats.INFINITE_BOUND, upper);
}
if (Double.isNaN(lower) || Double.isNaN(upper)) {
throw new NotANumberException();
}
final RandomGenerator generator = getRandomGenerator();
// ensure nextDouble() isn't 0.0