docs: protected void writeTerminalCount(final BitOutputStream out,
      final long value, final long max) throws IOException {
      assert 0 <= value;
      assert max >= value;
      if (SERIALIZATION_CHECKS) {
        out.write(SerializationChecks.BeforeTerminal);
      }
      out.writeBoundedLong(value, 1 + max);
      if (SERIALIZATION_CHECKS) {
        out.write(SerializationChecks.AfterTerminal);
      }
    }