Make the Java examples more consistent
Merge pull request #495 from everett-toews/java-consistency

Make the Java examples more consistent