Converted more Scala to Java.