Does the function Update remains in the final build even if its only used for Assertions methods?

Like in this example from the Unity docs, if we compile this in the final build the Update function will be empty, or it will be removed as well? since its not being used.

using UnityEngine;
using UnityEngine.Assertions;

public class AssertionExampleClass : MonoBehaviour
{
    public int health;
    public GameObject go;

    void Update()
    {
        // You expect the health never to be equal to zero
        Assert.AreNotEqual(0, health);

        // The referenced GameObject should be always (in every frame) be active
        Assert.IsTrue(go.activeInHierarchy);
    }
}

Yes it will stay in a build and furthermore it will still be executed. Unity does not strip unused or empty methods as it’s still possible to invoke a method through SendMessage. If you want to get rid of the Update method in builds, use preprocessor conditionals

#if UNITY_EDITOR
    void Update()
    {
        // You expect the health never to be equal to zero
        Assert.AreNotEqual(0, health);
 
        // The referenced GameObject should be always (in every frame) be active
        Assert.IsTrue(go.activeInHierarchy);
    }

#endif