/**
  * Disconnect, not a method one would normally see in an implementation of.
  *
  * @throws Exception the exception {@link StampyMessageListener}
  */
 public void disconnect() throws Exception {
   synchronized (waiter) {
     waiter.wait();
   }
   gateway.broadcastMessage(new DisconnectMessage());
   end = System.nanoTime();
 }
  private void sendAck(int i) throws InterceptException {
    String id = Integer.toString(i);
    AckMessage ack = new AckMessage(id);
    ack.getHeader().setReceipt(id);
    ack.getHeader().setTransaction(id);

    gateway.broadcastMessage(ack);
  }