Scala example updated after Java-friendly move of the API