Code example for Set

Methods: addAll

0
  public void remove(T elem) {
    ids.remove(elem);
  } 
 
  public void merge(ChoosableSet<T> toMerge) {
    ids.addAll(toMerge.ids);
  } 
 
  public boolean isEmpty() { 
    return ids.isEmpty();
  } 
 
  @Override 
  public Iterator<T> iterator() {
    return ids.iterator();
  } 
 
  public synchronized T choose() { 
    if (!ids.isEmpty()) {
      if (iter == null || !iter.hasNext()) {
        iter = ids.iterator();