add java code snippets