example implementations from http://vanillajava.blogspot.com/2013/04/low-gc-coding-efficient-listeners.html