@Test void testRandomElementOf() { String[] elements = {"foo", "bar"}; String element = CollectionUtils.randomElementOf(asList(elements)); assertThat(element).isIn(elements); }
public static <T> T randomElementOf(final List<T> list) { if (list.isEmpty()) { return null; } return list.get(nextInt(0, list.size())); }
CollectionUtils { public static <T> T randomElementOf(final List<T> list) { if (list.isEmpty()) { return null; } return list.get(nextInt(0, list.size())); } }
CollectionUtils { public static <T> T randomElementOf(final List<T> list) { if (list.isEmpty()) { return null; } return list.get(nextInt(0, list.size())); } private  CollectionUtils(); }
CollectionUtils { public static <T> T randomElementOf(final List<T> list) { if (list.isEmpty()) { return null; } return list.get(nextInt(0, list.size())); } private  CollectionUtils(); static T randomElementOf(final List<T> list); }
CollectionUtils { public static <T> T randomElementOf(final List<T> list) { if (list.isEmpty()) { return null; } return list.get(nextInt(0, list.size())); } private  CollectionUtils(); static T randomElementOf(final List<T> list);  }