### Question:
DashboardButton extends BaseQuickbarButton { void selectIf(String id) { setSelected(item.id().equals(id)); } DashboardButton(DashboardItem item);   }### Answer:
@Test public void selectIf() { DashboardButton victim = lookup(".quickbar-navigation-button").queryAs(DashboardButton.class); assertFalse(victim.isSelected()); victim.selectIf("ImNotMatching"); assertFalse(victim.isSelected()); WaitForAsyncUtils.waitForAsyncFx(2000, () -> victim.selectIf(DefaultPriorityDashboardItem.ID)); assertTrue(victim.isSelected()); }