code: public boolean supportsAutomaticNodeCreation()
                      throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
          ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection());
          return sdm.supportsFeature(pubSubService, AUTO_CREATE_FEATURE);
      }
docs: Check if the PubSub service supports automatic node creation.
  
  @return true if the PubSub service supports automatic node creation.
  @throws NoResponseException
  @throws XMPPErrorException
  @throws NotConnectedException
  @throws InterruptedException
  @since 4.2.1
  @see <a href="https://xmpp.org/extensions/xep-0060.html#publisher-publish-autocreate">XEP-0060 § 7.1.4 Automatic Node Creation</a>