code: @SuppressWarnings("unchecked")
    private InputConnection setupConnection(InputConnection connection) {
      log.debug(String.format("%s - Setting up connection: %s", this, connection));
      connection.messageHandler(messageHandler);
      for (Handler<InputBatch> handler : batchHandlers) {
        connection.batchHandler(handler);
      }
      if (groupHandler != null) {
        connection.groupHandler(groupHandler);
      }
      for (Map.Entry<String, Handler<InputGroup>> entry : groupHandlers.entrySet()) {
        connection.groupHandler(entry.getKey(), entry.getValue());
      }
      if (paused) {
        connection.pause();
      }
      return connection;
    }
docs: Sets up the given connection.