Just curious, which code is more effective:
if (myClass.getSomeValue() != myValue) myClass.setSomeValue(myValue); or simply
myClass.setSomeValue(myValue); , where getSomeValue() and setSomeValue(...) are simple getter-setter pair? It's clear, then second will be faster in case of .equals() usage, so we using just !=.