Java/Scala code