class ListCollector implements Collector {
  private static final int INIT_CAP = 10;
  @SuppressWarnings("rawtypes")
  List list;
  boolean returnArray;

  public ListCollector() {
    this(INIT_CAP, false);
  }

  public ListCollector(final boolean returnArray) {
    this(INIT_CAP, returnArray);
  }

  public ListCollector(final int size, final boolean returnArray) {
    this.list = new ArrayList<>(size > 0 ? size : INIT_CAP);
    this.returnArray = returnArray;
  }

  @SuppressWarnings("unchecked")
  @Override
  public void add(final Object e) {
    this.list.add(e);
  }

  @Override
  public Object getRawContainer() {<FILL_FUNCTION_BODY>}
}

    if (this.returnArray) {
      return this.list.toArray();
    } else {
      return this.list;
    }
  
<no_super_class>