Adding Java snippets to documentation

-Adding missing java code snippets to documentation 
There should be a space after the comma for consistency.