Get the title of the webpage and store in a variable
String actualTitle = driver.getTitle();
Type in the expected title
String expectedTitle = “abcdefgh";
Verify if both of them are equal
if(actualTitle.equalsIgnoreCase(expectedTitle))
System.out.println("Title Matched");
else
System.out.println("Title didn't match");
Alternatively,
Assert.assertEquals(actualTitle, expectedTitle);