To be fair, sealed classes were introduced in Java 15 back in 2020. But granted pattern matching is what makes them really useful.