Fix a generics type inferencing issue where an anonymous implementation is spuriously seen as incompatible by javac.
Use an intervening local variable to resolve a bad type inference in some javac compilers.