Source:
<code>public void searchTopicSubscriptions(String queueNamePattern, String identifierPattern, int ownNodeIdIndex, boolean isNameExactMatch, boolean isIdentifierExactMatch) { WebElement queueNamePatternField = driver.findElement(By.name(UIElementMapper.getInstance() .getElement("mb.search.topic.name.pattern.tag.name"))); queueNamePatternField.clear(); queueNamePatternField.sendKeys(queueNamePattern); WebElement queueIdentifierPatternField = driver.findElement(By.name(UIElementMapper.getInstance() .getElement("mb.search.topic.identifier.pattern.tag.name"))); queueIdentifierPatternField.clear(); queueIdentifierPatternField.sendKeys(identifierPattern); WebElement topicNameExactMatchField = driver.findElement( By.name(UIElementMapper.getInstance().getElement("mb.search.topic.name.exactmatch.tag.name"))); if (isNameExactMatch && !topicNameExactMatchField.isSelected()) { topicNameExactMatchField.click(); } if (!isNameExactMatch && topicNameExactMatchField.isSelected()) { topicNameExactMatchField.click(); } WebElement topicIdentifierExactMatchField = driver.findElement( By.name(UIElementMapper.getInstance().getElement("mb.search.topic.identifier.exactmatch.tag.name"))); if (isIdentifierExactMatch && !topicIdentifierExactMatchField.isSelected()) { topicIdentifierExactMatchField.click(); } if (!isIdentifierExactMatch && topicIdentifierExactMatchField.isSelected()) { topicIdentifierExactMatchField.click(); } <START> <END> Select ownNodeIdDropdown = new Select(driver.findElement(By.id(UIElementMapper.getInstance() .getElement("mb.search.topic.own.node.id.element.id")))); ownNodeIdDropdown.selectByIndex(ownNodeIdIndex); driver.findElement(By.xpath(UIElementMapper.getInstance() .getElement("mb.search.topic.search.button.xpath"))).click(); }</code><technical_language>if statements confusing. check if checking booleans same? a single if statement below. if (isIdentifierExactMatch != topicIdentifierExactMatchField.isSelected()) { topicIdentifierExactMatchField.click(); }</technical_language>

Target:
public void searchTopicSubscriptions(String queueNamePattern, String identifierPattern, int ownNodeIdIndex, boolean isNameExactMatch, boolean isIdentifierExactMatch) { WebElement queueNamePatternField = driver.findElement(By.name(UIElementMapper.getInstance() .getElement("mb.search.topic.name.pattern.tag.name"))); queueNamePatternField.clear(); queueNamePatternField.sendKeys(queueNamePattern); WebElement queueIdentifierPatternField = driver.findElement(By.name(UIElementMapper.getInstance() .getElement("mb.search.topic.identifier.pattern.tag.name"))); queueIdentifierPatternField.clear(); queueIdentifierPatternField.sendKeys(identifierPattern); WebElement topicNameExactMatchField = driver.findElement( By.name(UIElementMapper.getInstance().getElement("mb.search.topic.name.exactmatch.tag.name"))); if (isNameExactMatch != topicNameExactMatchField.isSelected()) { topicNameExactMatchField.click(); } WebElement topicIdentifierExactMatchField = driver.findElement( By.name(UIElementMapper.getInstance().getElement("mb.search.topic.identifier.exactmatch.tag.name"))); if (isIdentifierExactMatch != topicIdentifierExactMatchField.isSelected()) { topicIdentifierExactMatchField.click(); } Select ownNodeIdDropdown = new Select(driver.findElement(By.id(UIElementMapper.getInstance() .getElement("mb.search.topic.own.node.id.element.id")))); ownNodeIdDropdown.selectByIndex(ownNodeIdIndex); driver.findElement(By.xpath(UIElementMapper.getInstance() .getElement("mb.search.topic.search.button.xpath"))).click(); }