Tested on scala 2.10