code: public void endArray() throws IOException {
      int p = peeked;
      if (p == PEEKED_NONE) {
        p = doPeek();
      }
      if (p == PEEKED_END_ARRAY) {
        stackSize--;
        pathIndices[stackSize - 1]++;
        peeked = PEEKED_NONE;
      } else {
        throw new IllegalStateException("Expected END_ARRAY but was " + peek() + locationString());
      }
    }
docs: Consumes the next token from the JSON stream and asserts that it is the
  end of the current array.