One thing I liked was the chosen example is changing Booleans to enums. This almost always happens. Your field is almost never a Boolean. This goes for code too. We’ve all read code like:
foo(false, false, true, null);
This leads to coding standards that all such parameters must be commented and breakages when the parameter list is changed. It also often results in hacks to squeeze a third value into your Boolean (eg Optional<Boolean>).Or, my favorite:
@nullable Optional<Boolean>
As I like to say: for when three values for your Boolean just aren’t enough.So yeah, my tip for the day is just make any Boolean an enumeration from the outset.