docs: private JsonWriter close(int empty, int nonempty, String closeBracket) throws IOException {
      int context = peekScope();
      if (context != nonempty && context != empty) {
        throw new IllegalStateException("Nesting problem.");
      }
      if (deferredName != null) {
        throw new IllegalStateException("Dangling name: " + deferredName);
      }
  
      stackSize--;
      pathNames[stackSize] = null; // Free the last path name so that it can be garbage collected!
      pathIndices[stackSize - 1]++;
      if (context == nonempty) {
        newline();
      }
      sink.writeUtf8(closeBracket);
      return this;
    }