/** * Copy the current set and return a copy that is the difference of the current * set and <code>entries</code>. */ public CopyOnWriteHashSet<T> copyAndRemoveAll(Collection<?> entries) { CopyOnWriteHashMap<T, Boolean> updated = this.map.copyAndRemoveAll(entries); if (updated == map) { return this; } else { return new CopyOnWriteHashSet<>(updated); } }