code: private static Object generateExampleForRefModel(boolean generateMissingExamples, String simpleRef, Map<String, Model> definitions, DocumentResolver definitionDocumentResolver, MarkupDocBuilder markupDocBuilder, Map<String, Integer> refStack) {
          Model model = definitions.get(simpleRef);
          Object example = null;
          if (model != null) {
              example = model.getExample();
              if (example == null && generateMissingExamples) {
                  if (!refStack.containsKey(simpleRef)) {
                      refStack.put(simpleRef, 1);
                  } else {
                      refStack.put(simpleRef, refStack.get(simpleRef) + 1);
                  }
                  if (refStack.get(simpleRef) <= MAX_RECURSION_TO_DISPLAY) {
                      if (model instanceof ComposedModel) {
                          //FIXME: getProperties() may throw NullPointerException
                          example = exampleMapForProperties(((ObjectType) ModelUtils.getType(model, definitions, definitionDocumentResolver)).getProperties(), definitions, definitionDocumentResolver, markupDocBuilder, new HashMap<>());
                      } else {
                          example = exampleMapForProperties(model.getProperties(), definitions, definitionDocumentResolver, markupDocBuilder, refStack);
                      }
                  } else {
                      return "...";
                  }
                  refStack.put(simpleRef, refStack.get(simpleRef) - 1);
              }
          }
          return example;
      }
docs: Generates an example object from a simple reference
  
  @param generateMissingExamples specifies the missing examples should be generated
  @param simpleRef               the simple reference string
  @param definitions             the map of definitions
  @param markupDocBuilder        the markup builder
  @param refStack                map to detect cyclic references
  @return returns an Object or Map of examples