@Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof ListPoliciesResult == false) return false;
    ListPoliciesResult other = (ListPoliciesResult) obj;

    if (other.getPolicies() == null ^ this.getPolicies() == null) return false;
    if (other.getPolicies() != null && other.getPolicies().equals(this.getPolicies()) == false)
      return false;
    if (other.getNextMarker() == null ^ this.getNextMarker() == null) return false;
    if (other.getNextMarker() != null
        && other.getNextMarker().equals(this.getNextMarker()) == false) return false;
    return true;
  }
  public ListPoliciesResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListPoliciesResult listPoliciesResult = new ListPoliciesResult();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("policies", targetDepth)) {
          context.nextToken();
          listPoliciesResult.setPolicies(
              new ListUnmarshaller<Policy>(PolicyJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("nextMarker", targetDepth)) {
          context.nextToken();
          listPoliciesResult.setNextMarker(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return listPoliciesResult;
  }