public Hits unmarshall(JsonUnmarshallerContext context) throws Exception {
    Hits hits = new Hits();

    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("found", targetDepth)) {
          context.nextToken();
          hits.setFound(context.getUnmarshaller(Long.class).unmarshall(context));
        }
        if (context.testExpression("start", targetDepth)) {
          context.nextToken();
          hits.setStart(context.getUnmarshaller(Long.class).unmarshall(context));
        }
        if (context.testExpression("cursor", targetDepth)) {
          context.nextToken();
          hits.setCursor(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("hit", targetDepth)) {
          context.nextToken();
          hits.setHit(
              new ListUnmarshaller<Hit>(HitJsonUnmarshaller.getInstance()).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 hits;
  }