Make the Java examples more consistent