code: public static ModelNode getParentAddress(final ModelNode address) {
          if (address.getType() != ModelType.LIST) {
              throw new IllegalArgumentException("The address type must be a list.");
          }
          final ModelNode result = new ModelNode();
          final List<Property> addressParts = address.asPropertyList();
          if (addressParts.isEmpty()) {
              throw new IllegalArgumentException("The address is empty.");
          }
          for (int i = 0; i < addressParts.size() - 1; ++i) {
              final Property property = addressParts.get(i);
              result.add(property.getName(), property.getValue());
          }
          return result;
      }
docs: Finds the parent address, everything before the last address part.
  
  @param address the address to get the parent
  
  @return the parent address
  
  @throws IllegalArgumentException if the address is not of type {@link ModelType#LIST} or is empty