private void notifyClientsThatServerIsClosingAndCloseConnections() {
    ObjectOutputStream output;
    ServerStoppedMessage message = new ServerStoppedMessage();
    for (Connection it : connections) {
      try {
        output = it.getOutputStream();
        output.writeObject(message);
        output.flush();
        it.getSocket().close();
      }
      catch (IOException e) {
        // continue
      }
    }
    connections.clear();
  }