How to verify table headers against expected headers

Hey, so I have a script the collects the headers from a table on a page and I want to verify that the expected ( 9 headers) all have the same text as what is displayed on the table page.
I have this script which prints the headers from the table but I seem to have trouble on the last point which I have tried a verifytextpresent but doesnt work?

WebDriver driver = DriverFactory.getWebDriver()

WebElement Header = driver.findElement(By.xpath(‘//table/thead’))

List header_names = Header.findElements(By.tagName(‘th’))

int headers_count = header_names.size()

WebUI.verifyEqual(headers_count, ExpectedHeaders, FailureHandling.CONTINUE_ON_FAILURE)

for (int column = 0; column < headers_count; column++) {
def headertext = header_names.get(column).getText()