@Test public void testRandomListListOfT() { List<Integer> list = new ArrayList<>(); assertTrue(RandomUtils.randomList(list) == null); list.add(1); assertTrue(RandomUtils.randomList(list) == 1); }
public static <T> T randomList(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(nextInt(list.size())); }
RandomUtils { public static <T> T randomList(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(nextInt(list.size())); } }
RandomUtils { public static <T> T randomList(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(nextInt(list.size())); }  }
RandomUtils { public static <T> T randomList(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(nextInt(list.size())); }  static boolean nextBoolean(); static int nextInt(int bound); static int nextInt(int origin, int bound); static long nextLong(long bound); static long nextLong(long origin, long bound); static boolean isSuccess(float rate); static boolean isSuccess(double rate); static boolean isSuccessByPercentage(long rate); static boolean isSuccessByPermillage(long rate); static T randomList(List<T> list); @SuppressWarnings("unchecked") static List<T> randomList(final List<T> source, int num); static K randomByWeight(Map<K, Integer> data); static T randomByWeight(List<T> data, ToIntFunction<? super T> weightFunction); static List<T> randomByWeight(List<T> data, ToIntFunction<? super T> weightFunction, int num); }
RandomUtils { public static <T> T randomList(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(nextInt(list.size())); }  static boolean nextBoolean(); static int nextInt(int bound); static int nextInt(int origin, int bound); static long nextLong(long bound); static long nextLong(long origin, long bound); static boolean isSuccess(float rate); static boolean isSuccess(double rate); static boolean isSuccessByPercentage(long rate); static boolean isSuccessByPermillage(long rate); static T randomList(List<T> list); @SuppressWarnings("unchecked") static List<T> randomList(final List<T> source, int num); static K randomByWeight(Map<K, Integer> data); static T randomByWeight(List<T> data, ToIntFunction<? super T> weightFunction); static List<T> randomByWeight(List<T> data, ToIntFunction<? super T> weightFunction, int num);  }