adding some java snippets