Java examples for java.util:List Search
find Trailing Item in a List
//package com.java2s; import java.util.List; public class Main { public static <E> E findTrailingItem(final List<E> list, final E item) { boolean takeNextItem = false; for (E x : list) { if (takeNextItem) { return x; } else if (x == item) { takeNextItem = true;/* w w w. j av a 2 s. co m*/ } } return null; } }