Java, Java8, Java21, Java17, Migration.
with pattern matching directly in the conditional statement. This results in cleaner and more concise code, where the city is extracted directly from the object without the need for explicit accessor methods. Overall, the advancements in Java 21, particularly with the introduction of record