Source:
<code><START> public void handlerUsersParameterWhenOnlyTheUserParameterIsGiven() throws NotificationException <END> { final DocumentReference testUser = new DocumentReference("currentwiki", "XWiki", "SomeUser"); NotificationParameters notificationParameters = notificationParametersForUser(testUser); NotificationParameters expectedParameters = notificationParametersForUser(testUser); expectedParameters.filters = Collections.emptyList(); expectedParameters.filterPreferences = Collections.emptyList(); this.usersParameterHandler.handleUsersParameter("", notificationParameters); assertEquals(expectedParameters, notificationParameters); List<NotificationFilterPreference> userFilterPreferences = new ArrayList<>(); userFilterPreferences.add(getFilterPreference("currentwiki:XWiki.SomeUser")); NotificationFilterPreference userFollowingFilterPref1 = getFilterPreferenceWithName( "currentwiki:XWiki.Alice", "eventUserNotificationFilter"); userFilterPreferences.add(userFollowingFilterPref1); when(notificationFilterPreferenceManager.getFilterPreferences(testUser)) .thenReturn(userFilterPreferences); expectedParameters.filterPreferences = Collections.singletonList(userFollowingFilterPref1); notificationParameters = notificationParametersForUser(testUser); this.usersParameterHandler.handleUsersParameter("", notificationParameters); assertEquals(expectedParameters, notificationParameters); userFilterPreferences.add(getFilterPreferenceWithName("currentwiki:XWiki.SomeOther", "")); NotificationFilterPreference userFollowingFilterPref2 = getFilterPreferenceWithName( "currentwiki:XWiki.Bob", "eventUserNotificationFilter"); userFilterPreferences.add(userFollowingFilterPref2); userFilterPreferences.add(getFilterPreference("currentwiki:XWiki.SomeUser4")); expectedParameters.filterPreferences = Arrays.asList(userFollowingFilterPref1, userFollowingFilterPref2); notificationParameters = notificationParametersForUser(testUser); this.usersParameterHandler.handleUsersParameter("", notificationParameters); assertEquals(expectedParameters, notificationParameters); }</code><technical_language>note practice for test is public</technical_language>

Target:
void handlerUsersParameterWhenOnlyTheUserParameterIsGiven() throws NotificationException { final DocumentReference testUser = new DocumentReference("currentwiki", "XWiki", "SomeUser"); NotificationParameters notificationParameters = notificationParametersForUser(testUser); NotificationParameters expectedParameters = notificationParametersForUser(testUser); expectedParameters.filters = Collections.emptyList(); expectedParameters.filterPreferences = Collections.emptyList(); this.usersParameterHandler.handleUsersParameter("", notificationParameters); assertEquals(expectedParameters, notificationParameters); List<NotificationFilterPreference> userFilterPreferences = new ArrayList<>(); userFilterPreferences.add(getFilterPreference("currentwiki:XWiki.SomeUser")); NotificationFilterPreference userFollowingFilterPref1 = getFilterPreferenceWithName( "currentwiki:XWiki.Alice", "eventUserNotificationFilter"); userFilterPreferences.add(userFollowingFilterPref1); when(notificationFilterPreferenceManager.getFilterPreferences(testUser)) .thenReturn(userFilterPreferences); expectedParameters.filterPreferences = Collections.singletonList(userFollowingFilterPref1); notificationParameters = notificationParametersForUser(testUser); this.usersParameterHandler.handleUsersParameter("", notificationParameters); assertEquals(expectedParameters, notificationParameters); userFilterPreferences.add(getFilterPreferenceWithName("currentwiki:XWiki.SomeOther", "")); NotificationFilterPreference userFollowingFilterPref2 = getFilterPreferenceWithName( "currentwiki:XWiki.Bob", "eventUserNotificationFilter"); userFilterPreferences.add(userFollowingFilterPref2); userFilterPreferences.add(getFilterPreference("currentwiki:XWiki.SomeUser4")); expectedParameters.filterPreferences = Arrays.asList(userFollowingFilterPref1, userFollowingFilterPref2); notificationParameters = notificationParametersForUser(testUser); this.usersParameterHandler.handleUsersParameter("", notificationParameters); assertEquals(expectedParameters, notificationParameters); }