Java Language Pattern Matching Puzzlers

The goal of Project Amber within OpenJDK is to explore the inclusion of smaller, productivity-oriented Java language features. One part of this that has delivered new functionality in recent versions is pattern matching. Pattern matching combines application code logic to test if an expression has a specific type or structure and extract components of its state for processing. In this session, we’ll take several examples of pattern matching and pose them as questions, where sometimes, the results are not what you would expect. For each example, we’ll discuss the logic behind the code and how this could impact how you use these features in your code.

By the end of the session, you should have a greater depth of knowledge on how to get the most benefit from these Java language enhancements. It’s said that context is king. This phrase has become more important in recent times thanks to the rise of AI and LLMs. LLMs are evolving faster and faster every month. However, trained models lag in knowledge regarding recent events as well as specific data pertaining to your business, specially those models trained externally. This being said, there are ways to enhance these models with additional context enabling them to deliver results custom tailored to your specific needs.