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