docs: @SuppressWarnings({"checkstyle:npathcomplexity", "checkstyle:cyclomaticcomplexity",
  		"checkstyle:nestedifdepth"})
  	protected void appendComparisonFunctions(GenerationContext context, XtendTypeDeclaration source,
  			JvmGenericType target) {
  		if (isAppendComparisonFunctionsEnable(context, target)) {
  			boolean isEqualsUserDefined = false;
  			boolean isHashCodeUserDefined = false;
  			for (final JvmOperation operation : target.getDeclaredOperations()) {
  				if (Objects.equal(EQUALS_FUNCTION_NAME, operation.getSimpleName())
  						&& operation.getParameters().size() == 1
  						&& Objects.equal(Object.class.getName(),
  								operation.getParameters().get(0).getParameterType().getIdentifier())) {
  					isEqualsUserDefined = true;
  				} else if (Objects.equal(HASHCODE_FUNCTION_NAME, operation.getSimpleName())
  						&& operation.getParameters().isEmpty()) {
  					isHashCodeUserDefined = true;
  				}
  			}
  
  			if (!isEqualsUserDefined || !isHashCodeUserDefined) {
  				// Create a list of the declared non-static fields.
  				final List<JvmField> declaredInstanceFields = new ArrayList<>();
  				for (final JvmField field : target.getDeclaredFields()) {
  					if (isEqualityTestValidField(field)) {
  						declaredInstanceFields.add(field);
  					}
  				}
  
  				if (!declaredInstanceFields.isEmpty()) {
  					final Map<ActionPrototype, JvmOperation> finalOperations = new TreeMap<>();
  					Utils.populateInheritanceContext(
  							target, finalOperations, null, null, null, null, this.sarlSignatureProvider);
  
  					boolean couldCreateEqualsFunction = true;
  					if (!isEqualsUserDefined) {
  						final ActionPrototype prototype = new ActionPrototype(EQUALS_FUNCTION_NAME,
  								this.sarlSignatureProvider.createParameterTypesFromString(Object.class.getName()), false);
  						couldCreateEqualsFunction = !finalOperations.containsKey(prototype);
  					}
  
  					boolean couldCreateHashCodeFunction = true;
  					if (!isHashCodeUserDefined) {
  						final ActionPrototype prototype = new ActionPrototype(HASHCODE_FUNCTION_NAME,
  								this.sarlSignatureProvider.createParameterTypesForVoid(), false);
  						couldCreateHashCodeFunction = !finalOperations.containsKey(prototype);
  					}
  
  					if (couldCreateEqualsFunction && couldCreateHashCodeFunction) {
  						if (!isEqualsUserDefined) {
  							final JvmOperation op = toEqualsMethod(source, target, declaredInstanceFields,
  									context.getGeneratorConfig2().isGeneratePureAnnotation());
  							if (op != null) {
  								appendGeneratedAnnotation(op, context);
  								target.getMembers().add(op);
  							}
  						}
  
  						if (!isHashCodeUserDefined) {
  							final JvmOperation op = toHashCodeMethod(source, declaredInstanceFields,
  									context.getGeneratorConfig2().isGeneratePureAnnotation());
  							if (op != null) {
  								appendGeneratedAnnotation(op, context);
  								target.getMembers().add(op);
  							}
  						}
  					}
  				}
  			}
  		}
  	}