System.err.println("***************** ack of " + this + " cleared." + " in thread " + Thread.currentThread());
  public ATermAppl nextEvent()  {    if (events.size() == 0) {      ack = false;      return null;    }    ATermAppl event = (ATermAppl)events.get(0);    events.remove(0);    return event;  }