Write the enum TrafficLight with exactly three constants: RED, YELLOW, GREEN, in that order.
TrafficLight
RED
YELLOW
GREEN
main checks them: the program prints 3, RED, 2 — the count, the constant found by name, and the position of GREEN (positions start at 0).
main
3
2