Here you can find the source of mergeLong(List
public static List<Long> mergeLong(List<Long> l1, List<Long> l2, boolean sort)
//package com.java2s; /*//from ww w . ja v a 2s . co m * Copyright (C) ${year} Omry Yadan <${email}> * All rights reserved. * * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information */ import java.util.*; public class Main { public static List<Long> mergeLong(List<Long> l1, List<Long> l2, boolean sort) { Set<Long> set = new HashSet<Long>(l1); set.addAll(l2); List<Long> res = new ArrayList<Long>(set); if (sort) { Collections.sort(res); } return res; } }