code: public String buildJson() throws ODataRenderException {
          LOG.debug("Start building Json service root document");
          try (ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
              JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEncoding.UTF8);
              jsonGenerator.writeStartObject();
              jsonGenerator.writeStringField(CONTEXT, getContextURL(uri, entityDataModel));
              jsonGenerator.writeArrayFieldStart(VALUE);
  
  
              List<EntitySet> entities = entityDataModel.getEntityContainer().getEntitySets();
              for (EntitySet entity : entities) {
                  if (entity.isIncludedInServiceDocument()) {
                      writeObject(jsonGenerator, entity);
                  }
              }
  
              List<Singleton> singletons = entityDataModel.getEntityContainer().getSingletons();
              for (Singleton singleton : singletons) {
                  writeObject(jsonGenerator, singleton);
              }
  
              jsonGenerator.writeEndArray();
              jsonGenerator.writeEndObject();
              jsonGenerator.close();
              return stream.toString(StandardCharsets.UTF_8.name());
          } catch (IOException e) {
              throw new ODataRenderException("It is unable to render service document", e);
          }
      }
docs: The main method for Writer.
  It builds the service root document according to spec.
  
  @return output in json
  @throws ODataRenderException If unable to render the json service document