/** {@inheritDoc} */ @SuppressWarnings({"SuspiciousMethodCalls"}) public boolean retainAll(Collection<?> collection) { boolean modified = false; TLongIterator iter = iterator(); while (iter.hasNext()) { if (!collection.contains(Long.valueOf(iter.next()))) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean retainAll(TLongCollection collection) { if (this == collection) { return false; } boolean modified = false; TLongIterator iter = iterator(); while (iter.hasNext()) { if (!collection.contains(iter.next())) { iter.remove(); modified = true; } } return modified; }
private long any(TLongSet nodes) { TLongIterator iterator = nodes.iterator(); long id = iterator.next(); iterator.remove(); return id; }