docs: public static JvmTypeReference cloneWithTypeParametersAndProxies(
  			JvmTypeReference type,
  			Iterable<JvmTypeParameter> executableTypeParameters,
  			Map<String, JvmTypeReference> superTypeParameterMapping,
  			JvmTypeReferenceBuilder typeParameterBuilder, JvmTypesBuilder typeBuilder,
  			TypeReferences typeReferences, TypesFactory jvmTypesFactory) {
  		if (type == null) {
  			return typeParameterBuilder.typeRef(Object.class);
  		}
  
  		boolean cloneType = true;
  		JvmTypeReference typeCandidate = type;
  
  		// Use also cloneType as a flag that indicates if the type was already found in type parameters.
  		if ((executableTypeParameters.iterator().hasNext() || !superTypeParameterMapping.isEmpty()) && cloneType) {
  			final Map<String, JvmTypeParameter> typeParameterIdentifiers = new TreeMap<>();
  			for (final JvmTypeParameter typeParameter : executableTypeParameters) {
  				typeParameterIdentifiers.put(typeParameter.getIdentifier(), typeParameter);
  			}
  
  			if (type instanceof JvmParameterizedTypeReference) {
  				// Try to clone the type parameters.
  				cloneType = false;
  				typeCandidate = cloneAndAssociate(type, typeParameterIdentifiers, superTypeParameterMapping,
  						typeParameterBuilder, typeReferences, jvmTypesFactory);
  			} else if (type instanceof XFunctionTypeRef) {
  				// Try to clone the function reference.
  				final XFunctionTypeRef functionRef = (XFunctionTypeRef) type;
  				cloneType = false;
  				final XFunctionTypeRef cloneReference = XtypeFactory.eINSTANCE.createXFunctionTypeRef();
  				for (final JvmTypeReference paramType : functionRef.getParamTypes()) {
  					cloneReference.getParamTypes().add(cloneAndAssociate(
  							paramType, typeParameterIdentifiers, superTypeParameterMapping,
  							typeParameterBuilder, typeReferences, jvmTypesFactory));
  				}
  				cloneReference.setReturnType(cloneAndAssociate(
  						functionRef.getReturnType(), typeParameterIdentifiers, superTypeParameterMapping,
  						typeParameterBuilder, typeReferences, jvmTypesFactory));
  				cloneReference.setInstanceContext(functionRef.isInstanceContext());
  				typeCandidate = cloneReference;
  			}
  		}
  
  		// Do the clone according to the type of the entity.
  		assert typeCandidate != null;
  		final JvmTypeReference returnType;
  		if (!cloneType) {
  			returnType = typeCandidate;
  		} else {
  			returnType = typeBuilder.cloneWithProxies(typeCandidate);
  		}
  		return returnType;
  	}