if (alertLine == null) {
assertThat(branchCell.asText(), equalTo(" "));
assertThat(branchCell.getAttribute("class"), equalTo("numeric "+cssClass));
} else {
assertThat(branchCell.asText(), equalTo("info"));
HtmlAnchor anchor = (HtmlAnchor) branchCell.getFirstChild().getFirstChild();
final String alert[] = new String[1];
webClient.setAlertHandler(new AlertHandler() {
public void handleAlert(Page page, String message) {
alert[0] = message;
}
});
anchor.click();
assertThat(alert[0], containsString(alertLine));
}
}