Adding Java snippets to documentation

-Adding missing java code snippets to documentation