Java Collection Remove removeAny(Collection collection)

Here you can find the source of removeAny(Collection collection)

Description

remove Any

License

Apache License

Declaration

public static <T> T removeAny(Collection<T> collection) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {
    public static <T> T removeAny(Collection<T> collection) {
        T item = null;//from w ww  .  jav a 2  s  .  co  m

        if (collection.iterator().hasNext())
            item = collection.iterator().next();

        return item;
    }
}

Related

  1. removeAll(final Collection collection, final Collection remove)
  2. removeAll(final Collection collection, final T... objects)
  3. removeAllElements(Collection data, T value)
  4. removeAllFromCollection(Collection collection, Collection toRemove)
  5. removeAllFromSet(AbstractSet collection, Collection toRemove)
  6. removeArrayMarkerFromCollectionToString(Collection col)
  7. removeArrayToCollection(T[] array, Collection collection)
  8. removed(Collection old, Collection nu)
  9. removed(Collection a, Collection b)