public void sync() {

        for (Object o : add) {
            main.add(o);
        }
        for (Object o : remove) {
            main.remove(o);
        }

        add.clear();
        remove.clear();

    }