@@ -0,0 +1,2783 @@
+package com.pturpin.quickcheck.generator;%0A%0Aimport java.math.BigDecimal;%0Aimport java.math.BigInteger;%0A%0Aimport static com.google.common.base.Preconditions.checkArgument;%0A%0Apublic class Numbers %7B%0A%0A    public static Generator%3CInteger%3E integerGen() %7B%0A        return integerGen(Integer.MIN_VALUE, Integer.MAX_VALUE);%0A    %7D%0A%0A    public static Generator%3CInteger%3E integerGen(int min, int max) %7B%0A        checkArgument(max %3E min);%0A        return re -%3E re.nextInt() %25 (max - min) + min;%0A    %7D%0A%0A    public static Generator%3CLong%3E longGen() %7B%0A        return longGen(Long.MIN_VALUE, Long.MAX_VALUE);%0A    %7D%0A%0A    public static Generator%3CLong%3E longGen(long min, long max) %7B%0A        checkArgument(max %3E min);%0A        return re -%3E re.nextLong() %25 (max - min) + min;%0A    %7D%0A%0A    public static Generator%3CFloat%3E floatGen() %7B%0A        return floatGen(-Float.MAX_VALUE, Float.MAX_VALUE);%0A    %7D%0A%0A    public static Generator%3CFloat%3E floatGen(float min, float max) %7B%0A        checkArgument(max %3E min);%0A        return re -%3E re.nextFloat() * (max - min) + min; // FIXME handle overflow%0A    %7D%0A%0A    public static Generator%3CDouble%3E doubleGen() %7B%0A        return doubleGen(-Double.MAX_VALUE, Double.MAX_VALUE);%0A    %7D%0A%0A    public static Generator%3CDouble%3E doubleGen(double min, double max) %7B%0A        checkArgument(max %3E min);%0A        return re -%3E re.nextDouble() * (max - min) + min;  // FIXME handle overflow%0A    %7D%0A%0A    public static Generator%3CDouble%3E specialDouble() %7B%0A        return Generators.oneOf(Double.MIN_VALUE, Double.MAX_VALUE,%0A                Double.MIN_NORMAL, Double.NaN, 0.d, -0.d,%0A                Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY);%0A    %7D%0A%0A    public static Generator%3CBigInteger%3E bigIntegerGen(BigInteger min, BigInteger max) %7B%0A        checkArgument(max.compareTo(min) %3E 0);%0A        BigInteger delta = max.subtract(min);%0A%0A        int deltaNumBits = delta.bitCount();%0A        Generator%3CInteger%3E numBitsGen = integerGen(0, deltaNumBits);%0A%0A        return re -%3E %7B%0A            BigInteger generated = new BigInteger(numBitsGen.get(re), re);%0A            return generated.remainder(delta).add(min);%0A        %7D;%0A    %7D%0A%0A    public static Generator%3CBigDecimal%3E bigDecimalGen(BigDecimal min, BigDecimal max) %7B%0A        checkArgument(max.compareTo(min) %3E 0);%0A%0A        BigInteger minInt = min.unscaledValue();%0A        BigInteger maxInt = max.unscaledValue();%0A        Generator%3CBigInteger%3E bigIntGen = bigIntegerGen(minInt, maxInt);%0A%0A        int minScale = min.scale();%0A        int maxScale = max.scale();%0A        Generator%3CInteger%3E scaleGen = integerGen(minScale, maxScale);%0A%0A        BigDecimal delta = max.subtract(min);%0A%0A        return re -%3E %7B%0A            BigDecimal generated = new BigDecimal(bigIntGen.get(re), scaleGen.get(re));%0A            return generated.remainder(delta).add(min);%0A        %7D;%0A    %7D%0A%7D%0A

Create basic implementations (lambda) of numbers generators