Scala's Try, in Java