Like the additional suggestion here. Perhaps condense down to:
```
val str: Option[String] = Option(stringFromJava)
str match {
  case Some(s: String) => println("String of length " + s.length)
  case None => println("stringFromJava was null")
}
```
This reuses the variable name from the example.