package bpsm.edn.parser;

import java.util.Collections;
import java.util.LinkedList;

final class DefaultListFactory implements BuilderFactory {
    public CollectionBuilder builder() {
        return new CollectionBuilder() {
            LinkedList<Object> list = new LinkedList<Object>();
            public void add(Object o) {
                list.add(o);
            }
            public Object build() {
                return Collections.unmodifiableList(list);
            }
        };
    }
}
package bpsm.edn.parser;

import java.util.ArrayList;
import java.util.Collections;

final class DefaultListFactory implements BuilderFactory {
    public CollectionBuilder builder() {
        return new CollectionBuilder() {
            ArrayList<Object> list = new ArrayList<Object>();
            public void add(Object o) {
                list.add(o);
            }
            public Object build() {
                return Collections.unmodifiableList(list);
            }
        };
    }
}
Use ArrayList rather than LinkedList as backing for immutable lists.
Use ArrayList rather than LinkedList as backing for immutable lists.