In the near future with a new Java version we'd be able to simplify AST rewritings considerably: https://gavinray97.github.io/blog/what-good-are-record-patterns