void bake() {
        if (baked) {
            return; // don't re-bake when still valid
        }
        ArrayList<Listener[]> handlerslist = new ArrayList<Listener[]>();
        ArrayList<Integer> handleridslist = new ArrayList<Integer>();
        for (Entry<Order, ArrayList<Listener<TEvent>>> entry : handlerslots.entrySet()) {
            Order orderslot = entry.getKey();

            ArrayList<Listener<TEvent>> list = entry.getValue();

            int ord = orderslot.getIndex();
            handlerslist.add(list.toArray(new Listener[list.size()]));
            handleridslist.add(ord);
        }
        handlers = handlerslist.toArray(new Listener[handlerslist.size()][]);
        handlerids = new int[handleridslist.size()];
        for (int i = 0; i < handleridslist.size(); i++) {
            handlerids[i] = handleridslist.get(i);
        }
        baked = true;
    }