Clean up the Java example for chapter six a bit
match scala output
simplify the python example and make it a bit more like the scala/java example