List of usage examples for com.google.common.collect ImmutableSortedSet tailSet
ImmutableSortedSet<E> tailSet(E fromElement, boolean inclusive)
From source file:org.voltcore.utils.COWNavigableSet.java
@Override public E pollFirst() { while (true) { ImmutableSortedSet<E> snapshot = m_set.get(); E first = null;//www. ja va 2 s. c o m if (snapshot.size() > 0) { first = snapshot.first(); } else { return null; } ImmutableSortedSet.Builder<E> builder = ImmutableSortedSet.naturalOrder(); builder.addAll(snapshot.tailSet(first, false)); if (m_set.compareAndSet(snapshot, builder.build())) { return first; } } }