How do I detect exactly which GameObject with a "Threat" tag entered a collider?

I mean, how is it noted?

For 3D:

void OnCollisionEnter(Collision collision) {
   if (collision.gameObject.CompareTag("Threat")) {
      // do something crazy
      // collision.gameObject would be the gameobject that entered the collider
   }  
}

If 2D, it would be OnCollisionEnter2D and Collision2D