Projects all points in a collection.
 The +collection+ object must implement the +each+,
 +clear+, and << methods (just like an Array) for this to work.

 call-seq: inverse_all(collection) -> collection
192489
def inverse_all(collection)
      newcollection = collection.dup.clear
      collection.each do |point|
        newcollection << inverse(point)
      end
      newcollection
    end
990176
int addAll(Collection<? extends T> collection) {
        int positionOfInsert = mObjects.size();
        mObjects.addAll(collection);
        return positionOfInsert;
    }
1258151
function all(iterable){
      var C      = getConstructor(this)
        , values = [];
      return new C(function(res, rej){
        forOf(iterable, false, values.push, values);
        var remaining = values.length
          , results   = Array(remaining);
        if(remaining)$.each.call(values, function(promise, index){
          C.resolve(promise).then(function(value){
            results[index] = value;
            --remaining || res(results);
          }, rej);
        });
        else res(results);
      });
    }
855971
function Collection (items) {
		this.items = new ok.Items();
		this.start();
		if (items) {
			this.add(items);
		}
		this.init();
	}
590626
public static void inverse(int[] a)
  {
    for (int i = 0; i < a.length; i++) {
      if (a[i] >= 0) {
        inverseLoop(a, i);
      }
    }

    for (int i = 0; i < a.length; i++) {
      a[i] = ~a[i];
    }
  }
439767
public static <T> Collection<T> addAll(Collection<T> collection, Enumeration<T> enumeration) {
		if (null != collection && null != enumeration) {
			while (enumeration.hasMoreElements()) {
				collection.add(enumeration.nextElement());
			}
		}
		return collection;
	}
968757
public static <T> void addAll(Collection<? super T> collection, Collection<? extends T> toAdd)
    {
        if (collection == null || toAdd == null)
        {
            return;
        }
        if (toAdd instanceof RandomAccess)
        {
            List<? extends T> randomAccess = (List<? extends T>) toAdd;
            for (int i = 0, size = randomAccess.size(); i < size; i++)
            {
                T element = randomAccess.get(i);
                collection.add(element);
            }
        }
        else
        {
            collection.addAll(toAdd);
        }
    }
978217
@Override
	public boolean retainAll(Collection<?> collection) {
		if (dao == null) {
			return false;
		}
		boolean changed = false;
		CloseableIterator<T> iterator = closeableIterator();
		try {
			while (iterator.hasNext()) {
				T data = iterator.next();
				if (!collection.contains(data)) {
					iterator.remove();
					changed = true;
				}
			}
			return changed;
		} finally {
			IOUtils.closeQuietly(iterator);
		}
	}
454512
public static void addAll(Collection<Object> list, Object[] objects)
	{
		list.addAll(Arrays.asList(objects));
	}
90529
public static <T, R extends Collection<T>> R removeAllFrom(Iterable<? extends T> iterable, R targetCollection)
    {
        Iterate.removeAllIterable(iterable, targetCollection);
        return targetCollection;
    }
684264
public static <K, V> Collection<K> addAllKeysTo(Map<K, V> map, Collection<K> targetCollection)
    {
        MapIterate.forEachKey(map, CollectionAddProcedure.on(targetCollection));
        return targetCollection;
    }
753134
function (items) {
        var self = this;

        // Force single item into array
        if (!Tools.isArray(items)) {
          if (items instanceof Collection) {
            self.add(items.toArray());
          } else {
            push.call(self, items);
          }
        } else {
          push.apply(self, items);
        }

        return self;
      }
885739
@Override
	public boolean addAll(Collection<? extends E> c) {
		if(c.isEmpty()) return false;
		combine();
		if(combined==null) {
			combined = new HashSet<>(c);
			return true;
		} else {
			return combined.addAll(c);
		}
	}
108991
@Deprecated
    public static Collection collectAll(Collection self, Collection collector, Closure transform) {
        return collectNested((Iterable)self, collector, transform);
    }
255063
function List(parameters) {
    abstractions.Collection.call(this, utilities.types.LIST, parameters);

    // the array is a private attribute so methods that use it are defined in the constructor
    const array = [];

    this.acceptVisitor = function(visitor) {
        visitor.visitList(this);
    };
    
    this.toArray = function() {
        return array.slice();  // copy the array
    };

    this.getSize = function() {
        return array.length;
    };
    
    this.getItem = function(index) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        return array[index];
    };
    
    this.setItem = function(index, item) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        item = this.convert(item);
        const oldItem = array[index];
        array[index] = item;
        return oldItem;
    };
    
    this.addItem = function(item) {
        item = this.convert(item);
        array.push(item);
        return true;
    };
    
    this.insertItem = function(index, item) {
        item = this.convert(item);
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        array.splice(index, 0, item);
    };
    
    this.insertItems = function(index, items) {
        const iterator = items.getIterator();
        while (iterator.hasNext()) {
            const item = iterator.getNext();
            this.insertItem(index++, item);
        }
    };
    
    this.removeItem = function(index) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        const oldItem = array[index];
        if (oldItem) array.splice(index, 1);
        return oldItem;
    };
    
    this.removeItems = function(range) {
        const items = new List(this.getParameters());
        const iterator = range.getIterator();
        while (iterator.hasNext()) {
            const index = iterator.getNext();
            const item = this.removeItem(index);
            items.addItem(item);
        }
        return items;
    };
    
    this.sortItems = function(sorter) {
        sorter = sorter || new utilities.Sorter();
        sorter.sortCollection(this);
    };
    
    this.reverseItems = function() {
        array.reverse();
    };

    this.shuffleItems = function() {
        const size = this.getSize();
        for (var index = size; index > 1; index--) {
            const randomIndex = utilities.random.index(index);  // in range [1..index] ordinal indexing
            const item = this.getItem(index);
            this.setItem(index, this.getItem(randomIndex));
            this.setItem(randomIndex, item);
        }
    };
    
    this.deleteAll = function() {
        array.splice(0);
    };

    return this;
}
1014031
public static <T> Collection<T> addAll(Collection<T> collection, Iterator<T> iterator) {
		if (null != collection && null != iterator) {
			while (iterator.hasNext()) {
				collection.add(iterator.next());
			}
		}
		return collection;
	}
24615
function each(collection, fn, scope) {
  var i = 0,
    cont;

  for (i; i < collection.length; i++) {
    cont = fn.call(scope, collection[i], i);
    if (cont === false) {
      break; //allow early exit
    }
  }
}