Here you can find the source of isFirst(List
public static <V> boolean isFirst(List<V> list, V object)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static <V> boolean isFirst(List<V> list, V object) { V first = getFirst(list);//from w w w.j a v a2s . c o m return first.equals(object); } public static <V> V getFirst(List<V> list) { return getFirst(list, null); } public static <V> V getFirst(List<V> list, V defaultValue) { int size = list.size(); if (size > 0) { return list.get(0); } else { return defaultValue; } } public static <V> V get(List<V> list, int index, V defaultValue) { try { return list.get(index); } catch (Exception ignore) { } return defaultValue; } }