TestNG TimeOut Method

package testNG;
 
import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeTest;
 
public class TestNG_TimeOut_Method {
WebDriver driver;
 
@Test
public void seleniumlearn_Search_Java() {
driver.findElement(By.id("edit-search-block-form--2")).sendKeys("Java");
driver.findElement(By.id("edit-submit")).click();
}
 
@Test(timeOut=2000)
public void seleniumlearn_Search_TestNG() {
driver.findElement(By.id("edit-search-block-form--2")).sendKeys("TestNG");
driver.findElement(By.id("edit-submit")).click();
}
 
@BeforeTest
public void beforeTest() {
System.setProperty("webdriver.chrome.driver", "G:\\Lib\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
}
 
}