Adding some Java snippets