How does Selenium integrate with TestNG?

How does Selenium integrate with TestNG?

If the project contains numerous classes, adding Listeners to each one may be time consuming and error prone. In such instances, we may create a testng.xml file and include the listeners element in the XML. This listener is used throughout the test suite, regardless of the number of classes.