Here you can find the source of isInOrder(List> src, Object first, Object second)
private static boolean isInOrder(List<?> src, Object first, Object second)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { private static boolean isInOrder(List<?> src, Object first, Object second) { int firstIndex = src.indexOf(first); int secondIndex = src.indexOf(second); return firstIndex < secondIndex; }//from w ww . j av a2 s .c o m }