I have an enum list of all the states in the US as following:
public enum State { AL, AK, AZ, AR, ..., WY }
and in my test file, I will rea
Use .name() method. Like st.name(). e.g. State.AL.name() returns string "AL".
.name()
st.name()
State.AL.name()
So,
if(st.name().equalsIgnoreCase(s)) {
should work.