I tried putting the break after clicking an element, but after clicking the element it tries to iterate again
for (int i = 1; i < tableSize; i++) {
final List<WebElement> columnElements = tableRows.get(i).findElements(By.tagName("td"));
for(WebElement columnElement : columnElements) {
if(columnElement.getText().equalsIgnoreCase(alias)) {
findElement(By.xpath(button.replace("{rowValue}", String.valueOf(i)))).click();
findElement(By.xpath(("//tr[{rowValue}]" + text).replace("{rowValue}", String.valueOf(i)))).click();
break;
}
}
}