@Override public int addAllAbsent(@NotNull Collection<? extends E> c){
  Object[] cs=c.toArray();
  if (cs.length == 0) {
    return 0;
  }
  Object[] uniq=new Object[cs.length];
  Object[] elements;
  Object[] newElements;
  int added;
  do {
    elements=array;
    int len=elements.length;
    added=0;
    for (    Object e : cs) {
      if (indexOf(e,elements,0,len) < 0 && indexOf(e,uniq,0,added) < 0) {
        uniq[added++]=e;
      }
    }
    if (added == 0) {
      return 0;
    }
    newElements=Arrays.copyOf(elements,len + added,Object[].class);
    System.arraycopy(uniq,0,newElements,len,added);
  }
 while (!replaceArray(elements,newElements));
  return added;
}

@ Override public int addAllAbsent ( @ NotNull Collection < ? extends E > c ) { Object [ ] cs = c . toArray ( ) ; if ( cs . length == 0 ) { return 0 ; } Object [ ] uniq = new Object [ cs . length ] ; Object [ ] elements ; Object [ ] newElements ; int added ; do { elements = array ; int len = elements . length ; added = 0 ; for ( Object e : cs ) { if ( indexOf ( e , elements , 0 , len ) < 0 && indexOf ( e , uniq , 0 , added ) < 0 ) { uniq [ added ++ ] = e ; } } if ( added == 0 ) { return 0 ; } newElements = Arrays . copyOf ( elements , len + added , Object [ ] . class ) ; System . arraycopy ( uniq , 0 , newElements , len , added ) ; } while ( ! replaceArray ( elements , newElements ) ) ; return added ; }
appends all of the elements in the specified collection that are not already contained in this list , to the end of this list , in the order that they are returned by the specified collection ' s iterator .
