title: TestNG - How to get current class name from BeforeClass
body: <p>TestNG - How to get current class name from BeforeClass.</p>
  
  <p>I have class A with extends class B</p>
  
  <pre><code>class B {
      @BeforeClass
      public void beforeClass() {
          /* Need test class name 'A' */
      }
  }
  class A extends B {
      @Test
      public void test() {
          /* do something */
      }
  }
  </code></pre>
  
  <p>In BeforeClass I have tried the only two parameters which inject: ITestContext and XmlTest.
  However, no luck in determining how to get the class name from either.</p>
  
  <p>Anyone got any ideas?
  Thanks</p>