Fix java snippets