some older java snippets