public static void renderAll(float dt) {
        // Theoretically should be faster due to fewer cache misses. At least according to a
        // StackOverflow thread I once read:
        // http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array
        //
        // Also the adds/removes are done here because they are all going to happen in the tick phase
        // of entity processing, and we want to make sure there are no "ghosts" rendered of entities that
        // have actually been removed but aren't in our tracked lists yet.
        Collections.sort(addRemoveLater, twoTupleComparator);
        for(TwoTuple<Boolean, GameEntity> tt : addRemoveLater) {
            if(tt.one) {
                allEntities.remove(tt.two);
                layers.get(tt.two.getLayer()).remove(tt.two);
            }
            else {
                allEntities.add(tt.two);
                if(!layers.containsKey(tt.two.getLayer())) {
                    layers.put(tt.two.getLayer(), new LinkedList<GameEntity>());
                }
                layers.get(tt.two.getLayer()).push(tt.two);
            }
        }
        addRemoveLater.clear();

        Set<Long> keySet = layers.keySet();
        Long[] layerKeys = new Long[keySet.size()];
        keySet.toArray(layerKeys);

        Arrays.sort(layerKeys);
        for(Long layer : layerKeys) {
            for(GameEntity ge : layers.get(layer)) {
                ge.preRender(dt);
                ge.render(dt);
                ge.postRender(dt);
            }
        }
    }