code: public static Type createInlineType(Type type, String name, String uniqueName, List<ObjectType> inlineDefinitions) {
          if (type instanceof ObjectType) {
              return createInlineObjectType(type, name, uniqueName, inlineDefinitions);
          } else if (type instanceof ArrayType) {
              ArrayType arrayType = (ArrayType) type;
              arrayType.setOfType(createInlineType(arrayType.getOfType(), name, uniqueName, inlineDefinitions));
  
              return arrayType;
          } else if (type instanceof MapType) {
              MapType mapType = (MapType) type;
              if (mapType.getValueType() instanceof ObjectType)
                  mapType.setValueType(createInlineType(mapType.getValueType(), name, uniqueName, inlineDefinitions));
  
              return mapType;
          } else {
              return type;
          }
      }
docs: Returns a RefType to a new inlined type named with {@code name} and {@code uniqueName}.<br>
  The returned RefType point to the new inlined type which is added to the {@code inlineDefinitions} collection.<br>
  The function is recursive and support collections (ArrayType and MapType).<br>
  The function is transparent : {@code type} is returned as-is if type is not inlinable or if !config.isInlineSchemaEnabled().<br>
  
  @param type              type to inline
  @param name              name of the created inline ObjectType
  @param uniqueName        unique name of the created inline ObjectType
  @param inlineDefinitions a non null collection of inline ObjectType
  @return the type referencing the newly created inline ObjectType. Can be a RefType, an ArrayType or a MapType