code: public <I extends Item> LeafNode tryToPublishAndPossibleAutoCreate(String id, I item)
                      throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
          LeafNode leafNode = new LeafNode(this, id);
          leafNode.publish(item);
  
          // If LeafNode.publish() did not throw then we have successfully published an item and possible auto-created
          // (XEP-0163 § 3., XEP-0060 § 7.1.4) the node. So we can put the node into the nodeMap.
          nodeMap.put(id, leafNode);
  
          return leafNode;
      }
docs: Try to publish an item and, if the node with the given ID does not exists, auto-create the node.
  <p>
  Not every PubSub service supports automatic node creation. You can discover if this service supports it by using
  {@link #supportsAutomaticNodeCreation()}.
  </p>
  
  @param id The unique id of the node.
  @param item The item to publish.
  @param <I> type of the item.
  
  @return the LeafNode on which the item was published.
  @throws NoResponseException
  @throws XMPPErrorException
  @throws NotConnectedException
  @throws InterruptedException
  @since 4.2.1