public ImmutableSortedSet<T> newWithout(T element) { if (this.contains(element)) { TreeSortedSet<T> result = TreeSortedSet.newSet(this); result.remove(element); return result.toImmutable(); } return this; }
public ImmutableSortedSet<T> newWithoutAll(Iterable<? extends T> elements) { TreeSortedSet<T> result = TreeSortedSet.newSet(this); this.removeAllFrom(elements, result); return result.toImmutable(); }
public ImmutableSortedSet<T> newWithAll(Iterable<? extends T> elements) { TreeSortedSet<T> result = TreeSortedSet.newSet(this); result.addAllIterable(elements); return result.toImmutable(); }
public ImmutableSortedSet<T> filterNot(Predicate<? super T> predicate) { TreeSortedSet<T> result = TreeSortedSet.newSet(this.comparator()); this.forEach(new FilterNotProcedure<T>(predicate, result)); return result.toImmutable(); }