title: How to write a TestNG listener that can list all groups of a Test Method?
body: <p>My sample testNG method is as below:</p>
  
  <pre><code>@Test(groups = { "regression", "sanity", "TTD-001" })
  public void createProject() {
     //Some execution happens
  }
  </code></pre>
  
  <p>Can we write a listener class, which can give me a string array of { "regression", "sanity", "TTD-001" } of the individual tests that were executed. Here the unique value TTD-001 has been mapped with a bug tracking utility that should be updated based on the execution status of the test method.</p>
  
  <p>Is this possible, or please suggest any other possible ways to handle this?</p>