@SuppressWarnings("unchecked")
    void applyLog(List<LogEntry> log, HGSortedSet<E> set)
    {
        for (LogEntry e : log)
            switch (e.op)
            {
                case ADD: { set.add((E)e.el); break; }
                case REMOVE: { set.remove((E)e.el); break; }
                case CLEAR: { set.clear(); break; }
                case ADDALL: { set.addAll((Collection<E>)e.el); break; }
                case REMOVEALL: { set.removeAll((Collection<E>)e.el); break; }
                case RETAINALL: { set.retainAll((Collection<E>)e.el); break; }
            }
    }