code: public synchronized EventData getNextEvent() throws DevFailed {
          if (events.size() == 0)
              Except.throw_exception("BUFFER_EMPTY",
                      "Event queue is empty.",
                      "EventQueue.getNextEvent()");
          EventData ev_data = events.get(0);
          events.remove(0);
          return ev_data;
      }
docs: ==================================================================