private void pushActiveTag(final String tag) {
      if (this.tagLevel >= this.activeTags.length) {
        this.activeTags = Arrays.copyOf(this.activeTags, this.activeTags.length * 2);
      }
      this.activeTags[this.tagLevel++] = tag;
    }
mark tag boundaries within the stack, without needing to mess with typing too much.
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/MiniMessageSerializer.java