Page object model not extending driver from class
<p><strong>Base Class :</strong></p>

<pre><code>protected WebDriver driver;
protected String URL = "https://www.example.com/";
public static String SignupURL = "https://www.example.com/login";
public Login loginpage;

@BeforeClass
public void setup()
{

    System.setProperty("webdriver.chrome.driver","E:\\Selenium-Webdriver\\Chrome_Driver\\chromedriver.exe");
    driver = new ChromeDriver();
    driver.manage().window().maximize();
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    driver.navigate().to(URL);
    loginpage = PageFactory.initElements(driver,Login.class);

}
</code></pre>

<p><strong>Login Class :</strong></p>

<pre><code>protected WebDriver driver;

public Login(WebDriver driver) {
    this.driver = driver;}

public Login Method1()
{

    //Logic

}
</code></pre>

<p><strong>LoginTest Class :</strong></p>

<pre><code>  public class LoginTest extends Base {

  @Test
 public void method1()
 {
        setup() //Have to Call it
       //Logic

  }

 @Test 
 public void method2
 {   
     setup() //Have to Call it 
     //Logic
  }
</code></pre>

<p>}</p>

<p>Question is Why it require to call <strong>setup()</strong> method for every method in test class. </p>

<p>I am already extending class then driver should call automatically but it's not. When I do not call <strong>setup()</strong> then getting <strong>Nullpointer Exception</strong>, If I call it then system opening new browser for each and every method.</p>