Code for tutorial on my blog http://taywils.me/2013/11/05/javasparkframeworktutorial.html