docs: private String jsonStringOf(Policy policy) throws JsonGenerationException,
              IOException {
          generator.writeStartObject();
  
          writeJsonKeyValue(JsonDocumentFields.VERSION, policy.getVersion());
  
          if (isNotNull(policy.getId()))
              writeJsonKeyValue(JsonDocumentFields.POLICY_ID, policy.getId());
  
          writeJsonArrayStart(JsonDocumentFields.STATEMENT);
  
          for (Statement statement : policy.getStatements()) {
              generator.writeStartObject();
  
              if (isNotNull(statement.getId())) {
                  writeJsonKeyValue(JsonDocumentFields.STATEMENT_ID, statement.getId());
              }
              writeJsonKeyValue(JsonDocumentFields.STATEMENT_EFFECT, statement
                      .getEffect().toString());
  
              List<Principal> principals = statement.getPrincipals();
              if (isNotNull(principals) && !principals.isEmpty())
                  writePrincipals(principals);
  
              List<Action> actions = statement.getActions();
              if (isNotNull(actions) && !actions.isEmpty())
                  writeActions(actions);
  
              List<Resource> resources = statement.getResources();
              if (isNotNull(resources) && !resources.isEmpty())
                  writeResources(resources);
  
              List<Condition> conditions = statement.getConditions();
              if (isNotNull(conditions) && !conditions.isEmpty())
                  writeConditions(conditions);
  
              generator.writeEndObject();
          }
  
          writeJsonArrayEnd();
  
          generator.writeEndObject();
  
          generator.flush();
  
          return writer.toString();
  
      }