I have Enum
public class TestResult {
MY_ENUM {
@Override
public String toString() {
return "Test1";
}
@Override
public boolean isTested() {
return true;
}
public abstract boolean isTested();
}
private MY_ENUM myEnum;
public MY_ENUM getMyEnum() {
return myEnum ;
}
}
I have other class the keep the varaible
public class Result {
private final TestResult testResult ;
}
I want to check if testResult.getMyEnum() equal TestResult.MY_ENUM.
Do I need to do it :
1 . testResult.getMyEnum() == TestResult.MY_ENUM.
Does it check the value of toString and isTested?
2. testResult.getMyEnum().toString().equal(TestResult.MY_ENUM.toString())
3. testResult.getMyEnum().equal(TestResult.MY_ENUM)
Does it check the value of toString and isTested?