package com.vryba.selenium.utilities;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;

import static org.testng.Assert.fail;

public class TestBase {

    private String baseUrl = Constant.URL;
    private StringBuffer verificationErrors = new StringBuffer();
    private Logger LOG = LogManager.getFormatterLogger();
    // annotated method will be run before the first test method in the current class is invoked
    @BeforeClass
    public void methodSetup() {
        BrowserFactory.startBrowser(BrowserFactory.BrowserType.FirefoxDriver, baseUrl);
        LOG.info("Starting Browser");
    }
    // annotated method will be run after each test method
    @AfterMethod
    public void testCleanUp() {
        new BrowserUtilities().executeJSCode(BrowserUtilities.CLEAR_LOCAL_STORAGE);
    }
    // annotated method will be run after all the test methods in the current class have been run
    @AfterClass(alwaysRun = true)
    public void tearDown() {
        BrowserFactory.closeSession();
        String verificationErrorString = verificationErrors.toString();
        if (!"".equals(verificationErrorString)) {
            fail(verificationErrorString);
        } else
            LOG.info("Browser Closed");
    }
}

@@ -205,51 +205,8 @@
 od;%0A
-import org.testng.annotations.BeforeClass;%0A
 impo
@@ -245,17 +245,16 @@
 Method;%0A
-%0A
 import s
@@ -347,16 +347,21 @@
 onstant.
+BASE_
 URL;%0A   
@@ -589,21 +589,22 @@
  @Before
-Class
+Method
 %0A    pub
@@ -752,36 +752,32 @@
 rowser%22);%0A    %7D%0A
-    
 // annotated met
@@ -811,24 +811,24 @@
 test method%0A
+
     @AfterMe
@@ -948,22 +948,23 @@
 ORAGE);%0A
-
     %7D%0A
+%0A
     // a

Replace TestNG @BeforeClass with @BeforeMethod annotation