Here you can find the source of mergeList(List
public static List<Integer> mergeList(List<Integer> list1, List<Integer> list2)
//package com.java2s; import java.util.Collections; import java.util.List; public class Main { public static List<Integer> mergeList(List<Integer> list1, List<Integer> list2) { list1.addAll(list2);//ww w. ja v a 2 s .com Collections.sort(list1); return list1; } }