Created
September 2, 2021 10:13
-
-
Save arslan-gg/e3ec73cd55ef68b94d497662f3865956 to your computer and use it in GitHub Desktop.
Get random value from provided list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SafeVarargs | |
public final <T> T oneOf(T... values) { | |
return values[faker.number().numberBetween(0, new Random().nextInt(values.length))]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment