static Random random_random = new Random; static int random(int n) { return n <= 0 ? 0 : random_random.nextInt(n); } static double random(double max) { return random()*max; } static double random() { return random_random.nextInt(100001)/100000.0; } static double random(double min, double max) { return min+random()*(max-min); } // min <= value < max static int random(int min, int max) { return min+random(max-min); } static A random(L l) { ret oneOf(l); } static A random(Collection c) { if (c instanceof L) ret random((L) c); int i = random(l(c)); ret collectionGet(c, i); }