Is your feature request related to a problem? Please describe
Coming from #17769 (comment), there are many classes (and tests!) where we would replace multiple chained if-statements to make use of switch pattern matching to make them more readable
Describe the solution you'd like
An example class is NestedHelper.java where we match the query type in an if-else statement. This can be replaced to use switch statements
Related component
Other
Describe alternatives you've considered
No response
Additional context
No response