code: public boolean canCreateNodesAndPublishItems() throws NoResponseException, NotConnectedException, InterruptedException, XMPPErrorException {
          LeafNode leafNode = null;
          try {
              leafNode = createNode();
          }
          catch (XMPPErrorException e) {
              if (e.getStanzaError().getCondition() == StanzaError.Condition.forbidden) {
                  return false;
              }
              throw e;
          } finally {
              if (leafNode != null) {
                  deleteNode(leafNode.getId());
              }
          }
          return true;
      }
docs: Check if it is possible to create PubSub nodes on this service. It could be possible that the
  PubSub service allows only certain XMPP entities (clients) to create nodes and publish items
  to them.
  <p>
  Note that since XEP-60 does not provide an API to determine if an XMPP entity is allowed to
  create nodes, therefore this method creates an instant node calling {@link #createNode()} to
  determine if it is possible to create nodes.
  </p>
  
  @return <code>true</code> if it is possible to create nodes, <code>false</code> otherwise.
  @throws NoResponseException
  @throws NotConnectedException
  @throws InterruptedException
  @throws XMPPErrorException