Code example for Random

Methods: nextInt

0
		else if (PrimitiveUtils.isFloat(clazz))
			return (F)new Float(Math.floor(Math.abs(random.nextFloat()))+.1);
		else if (PrimitiveUtils.isBigDecimal(clazz))
			return (F)new BigDecimal(Math.floor(Math.abs(random.nextFloat()))+.1);	
		else if (PrimitiveUtils.isString(clazz))
			return (F)new String("String"+Math.abs(random.nextInt()));
		else if (PrimitiveUtils.isDate(clazz)) {
			final long min = maxTime + random.nextInt();
			calendar.setTimeInMillis(min); 
			return (F)calendar.getTime();
		} 
		else if (PrimitiveUtils.isBoolean(clazz))
			return (F)(random.nextInt() % 2 == 0 ? Boolean.TRUE : Boolean.FALSE);
		else if (PrimitiveUtils.isObject(clazz))
			return (F)new Integer(-1);
		throw new RuntimeException(String.format("Class %s not supported", clazz.getSimpleName()));
	} 
	static Calendar calendar;
	static long maxTime;
	static { 
Contextual code suggestions in your IDE  Get Codota for Java