code: @Override
    public void close() {
      int size = stackSize;
      if (size > 1 || size == 1 && stack.get(size - 1) != JsonScope.NONEMPTY_DOCUMENT) {
        logger.log(Level.SEVERE, "Incomplete document");
        throw new JsonSerializationException("Incomplete document");
      }
      stackSize = 0;
    }
docs: {@inheritDoc}