code: public static Address fromModelNode(ModelNode node) {
          // Rather than just store node as this.addressNode, we want to make sure it can be used as a valid address.
          // This also builds our own instance of ModelNode rather than use the one the caller gave us.
          Address address = Address.root();
  
          // if the node is not defined, this simply represents the root address
          if (!node.isDefined()) {
              return address;
          }
  
          try {
              List<Property> addressList = node.asPropertyList();
              for (Property addressProperty : addressList) {
                  String resourceType = addressProperty.getName();
                  String resourceName = addressProperty.getValue().asString();
                  address.add(resourceType, resourceName);
              }
              return address;
          } catch (Exception e) {
              throw new IllegalArgumentException("Node cannot be used as an address: " + node.toJSONString(true));
          }
      }
docs: Obtains the address from the given ModelNode which is assumed to be a property list that
  contains all the address parts and only the address parts.
  
  @param node address node
  @return the address