Scala port for some java classes.