import scala.collection.JavaConverters._ val line: List[String] = null val myTry = Try(line.asJava) val result = myTry match { case Success(_) => "Success" case Failure(_) => "Failure" } println(result) This code snippet prints "Success". If I try to access myTry.get, then it throws a NullPointerException.
From how I understand Try, shouldn't myTry be a Failure?