AlertsCountContext { public boolean isCountUserAlerts() { boolean isValid = owner != null && !countSharedAlerts && !countPrivateAlerts; return isValid && countUserAlerts; } private  AlertsCountContext(AlertsCountContextBuilder builder); boolean isCountUserAlerts(); boolean isCountSharedAlerts(); boolean isCountPrivateAlerts(); PrincipalUser getPrincipalUser(); String getSearchText();  }
@Test public void isCountUserAlerts() { AlertsCountContext context = new AlertsCountContext.AlertsCountContextBuilder().countUserAlerts() .setPrincipalUser(owner).setSearchText(searchText).build(); assertEquals(true, context.isCountUserAlerts()); context = new AlertsCountContext.AlertsCountContextBuilder().countUserAlerts().build(); assertEquals(false, context.isCountUserAlerts()); }