public class MostlyLocalList<E> {
  // ...
  
  /**
   * Create a MostlyLocalList asking to have at most
   * {@code threadLocalAllocatorSize} elements in each thread specific list.  
   */
  public MostlyLocalList(int threadLocalAllocatorSize) {
    // ...
  }
  
  /**
   * Add an element to the a thread specific list and
   * if the thread specific list contains {@code threadLocalAllocatorSize}
   * elements, the elements are copied into the global dynamic array and
   * the thread speficic list is cleared.
   * @param element the element to add.
   */
  public void add(E element) {
    // ...
  }
  
  /**
   * Copied all elements from the thread specific list into the global
   * dynamic array and free all bookeeping data structured specific to
   * the current thread.
   */
  public void flush() {
    // ...
  }
  
  public int size(){
    //...
  }
}
 
