Randomize enum elements
From https://stackoverflow.com/questions/8114174/how-to-randomize-enum-elements
public enum LightColor {
Green,
Yellow,
Red;
public static LightColor getRandom() {
return values()[(int) (Math.random() * values().length)];
}
}
LightColor randomLightColor = LightColor.getRandom();