Here you can find the source of removeReference(List l, Object o)
public static Object removeReference(List l, Object o)
//package com.java2s; //License from project: Apache License import java.util.List; import java.util.Iterator; public class Main { public static Object removeReference(List l, Object o) { Iterator iter = l.iterator(); while (iter.hasNext()) { Object no = iter.next(); if (no == o) { iter.remove();/* w ww. ja va 2s.c o m*/ return o; } } return null; } }