It could be done by getting the page title by Selenium and do assertion by using TestNG.
Import Assert class in the import section:
`import org.testng.Assert;`
Create a WebDriver object:
WebDriver driver=new FirefoxDriver();
Apply this to assert the title of the page:
Assert.assertEquals("Expected page title", driver.getTitle());