Java tutorial
//package com.java2s; /* * 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); } }