Added example/test for http://stackoverflow.com/q/16796519/23354