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