Java anonymous class efficiency implications
The only practical difference between the anonymous classes and the top-level classes is that the anonymous classes will hold an implicit reference to the outer class. This won’t manifest itself in performance, but will impact you if you ever serialise these classes.