Make the Java examples more consistent

I thought the consistent way was the other way around.