Adding Java snippets to documentation