2017-06-07 22:30 GMT+02:00 Steven Costiou <steven.costiou@kloum.io>:
But would it not be faster to just change the class (which finally works with a little tuning) ?

In fact your solution with anonymous subclass is doing what I describe underhood.