The list of methods to do Collection Remove are organized into topic(s).
boolean
remove(Collection collection, Object object) remove
boolean removed = false;
Iterator it = collection.iterator();
while (it.hasNext()) {
Object o = it.next();
if (o.equals(object)) {
removed = true;
it.remove();
break;
...
Collection
remove(Collection p_collection, int p_index, int p_numberOfObjects) Removes the element at the specified position in the collection.
if (p_collection == null) {
return null;
List returnList = new ArrayList(p_collection.size() - p_numberOfObjects);
Iterator it = p_collection.iterator();
for (int i = 0; it.hasNext(); i++) {
if (i < p_index || i >= p_index + p_numberOfObjects) {
returnList.add(it.next());
...
List
remove(Collection collection, final int count)
Removes the specified number of elements from the collection, returns them as a list.
List<T> list = new ArrayList<T>();
while (list.size() < count && collection.size() > 0) {
T value = collection.iterator().next();
list.add(value);
collection.remove(value);
return list;