Snippets of practice java code