I create a random email method in selenium but would like to know how to create a permanent method for the same in the Selenium web driver, so it will save time in testing.
driver.findElement(By.id("email")).click();
Random randomEmail = new Random();
int randomInt = randomEmail.nextInt(1000);
driver.findElement(By.id("email")).sendKeys("username" + randomInt + "@gmail.com");