Returns a random element from an array. @param array The array to take a random element from. @param The type of the elements in the array. @return A randomly selected element from the array.
(E[] array)
| 39 | * @return A randomly selected element from the array. |
| 40 | */ |
| 41 | public <E> E nextElement(E[] array) { |
| 42 | return array[faker.random().nextInt(array.length)]; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Returns a random element from a list. |