Earlier quoted context omitted.
or using the switch as an expression System.out.println(switch(day) { case MONDAY, FRIDAY, SUNDAY -> 6; case TUESDAY -> 7; case THURSDAY, SATURDAY -> 8; case WEDNESDAY -> 9; });
That's much nicer. Anything else added to Java recently to reduce the boilerplate? I haven't used Java much in 5-6 years. Glad they are iterating faster.
Nullaway and a bunch of other linters will also save you from accidentally falling in one of the dusty corners.
RxJava and Java Streams are also very nice.
Anonymous classes are nice too I guess (although they're fairly limited).
Overall the java experience has improved massively in the last 5 years, but you need to know where to look. Highly recommend the two popular "awesome java" repos on GitHub for an overview