public DescribeEventCategoriesResult unmarshall(StaxUnmarshallerContext context)
      throws Exception {
    DescribeEventCategoriesResult describeEventCategoriesResult =
        new DescribeEventCategoriesResult();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 2;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return describeEventCategoriesResult;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("EventCategoriesMapList/EventCategoriesMap", targetDepth)) {
          describeEventCategoriesResult
              .getEventCategoriesMapList()
              .add(EventCategoriesMapStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return describeEventCategoriesResult;
        }
      }
    }
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof DescribeEventCategoriesResult == false) return false;
    DescribeEventCategoriesResult other = (DescribeEventCategoriesResult) obj;
    if (other.getEventCategoriesMapList() == null ^ this.getEventCategoriesMapList() == null)
      return false;
    if (other.getEventCategoriesMapList() != null
        && other.getEventCategoriesMapList().equals(this.getEventCategoriesMapList()) == false)
      return false;
    return true;
  }