In scala it is idomatic to use `Option[FileSystem.Statistics]` as the return type instead of returning possibly null.

It is also common to write loops like this in a functional manner:
    
     import scala.collection.JavaConversions._
     FileSystem.getAllStatistics().filter(s => s.getScheme.equals(scheme)).headOption