Matt's Java code Snippets