As we know from official TestNG documentation:
@BeforeClass:
The annotated method will be run before the first test method in the current class is invok
if you extend from another class this are the results:
parentTest - BeforeTest- parent
testClass1 - BeforeTest- test1
parentTest - BeforeClass- parent
testClass1 - BeforeClass- test1
parentTest - BeforeMethod- parent
testClass1 - BeforeMethod- test1
testClass1 - myTestMethod1
testClass1 - AfterMethod- test1
parentTest - AfterMethod- parent
parentTest - BeforeMethod- parent
testClass1 - BeforeMethod- test1
testClass1 - myTestMethod2
testClass1 - AfterMethod- test1
parentTest - AfterMethod- parent
testClass1 - AfterClass- test1
parentTest - AfterClass- parent
testClass1 - AfterTest- test1
parentTest – AfterTest- parent