Is this wrapping as ListBuffer() necessary?

Also, there is JavaConverters instead of JavaConversions:
  import scala.collection.JavaConverters._
  layout.setLocalityGroups(newGroups.asJava)

JavaConverters is preferable in some circumstances as it make conversions explicit, using collection.asJava or collection.asScala constructs.