code: private int readSequenceBegin() throws TException {
          getCurrentContext().read();
          if (getCurrentContext().isMapKey()) {
              throw new TException(SEQUENCE_AS_KEY_ILLEGAL);
          }
  
          final JsonNode curElem = getCurrentContext().getCurrentChild();
          if (!curElem.isArray()) {
              throw new TException("Expected JSON Array!");
          }
  
          pushContext(new SequenceContext(curElem));
          return curElem.size();
      }
docs: Helper shared by read{List/Set}Begin.