Here you can find the source of splice(LinkedList
public static <V> void splice(LinkedList<V> list, Iterator<V> iterator, LinkedList<V> list2, V v)
//package com.java2s; /*/*from ww w .jav a2 s.c om*/ * Copyright (C) 2009 Emweb bvba, Leuven, Belgium. * * See the LICENSE file for terms of use. */ import java.util.Iterator; import java.util.LinkedList; public class Main { public static <V> void splice(LinkedList<V> list, Iterator<V> iterator, LinkedList<V> list2, V v) { list2.remove(v); assert (iterator.equals(list.iterator())); list.addFirst(v); } }