Here you can find the source of addAllFirst(Collection
public static <T> void addAllFirst(Collection<T> col, Deque<T> deque)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <T> void addAllFirst(Collection<T> col, Deque<T> deque) { for (T item : col) { deque.addFirst(item);//from w w w. j av a 2 s .co m } } }