1. List 轉 Seq:java
List<String> tmpList = new ArrayList<>(); tmpList.add("abc"); Seq<String> tmpSeq = JavaConverters.asScalaIteratorConverter(tmpList.iterator()).asScala().toSeq();
2. Seq 轉 List:scala
List<String> tmpList = scala.collection.JavaConversions.seqAsJavaList(tmpSeq);
import scala.collection.JavaConverters._ val list: java.util.List[Int] = Seq(1,2,3,4).asJava val buffer: scala.collection.mutable.Buffer[Int] = list.asScala