Instead of using the ternary operators or the if statements in your examples, why don't you just return the value of the boolean going into the if or ternary?
Instead if this:
Code:
boolean getState() {
if(this.thing.state) {
return true;
else {
return false;
}
}
or this:
Code:
boolean getStateTernary() {
return this.thing.state ? true : false;
}
why not just this?
Code:
boolean getState() {
return this.thing.state;
}