Miscelleneous snippets comparing Java and Scala