Here you can find the source of sortLongSeqList(List
public static List<Long> sortLongSeqList(List<Long> firstList, List<Long> secondList)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Long> sortLongSeqList(List<Long> firstList, List<Long> secondList) { List<Long> entry = new ArrayList<Long>(); if (firstList != null && firstList.size() > 0) { if (secondList != null && secondList.size() > 0) { int seq = 0; for (int i = 0; i < firstList.size(); i++) { for (int j = 0; j < secondList.size(); j++) { if (secondList.get(j) == firstList.get(i).longValue()) { entry.add(seq, secondList.get(j)); seq++;//from w w w . j av a 2 s . com } } } } } return entry; } }