Updating Structure.java for Scala compatibility