Here you can find the source of removeFirst(Collection
public static <X> Collection<X> removeFirst(Collection<X> c)
//package com.java2s; import java.util.*; public class Main { public static <X> Collection<X> removeFirst(Collection<X> c) { List<X> list;/*from w w w . jav a2 s . c o m*/ if (c == null || c.size() == 0) { list = Collections.emptyList(); } else { list = new ArrayList<X>(c); list.remove(0); } return list; } }