### Question:
DefaultNotificationPreferenceManager implements NotificationPreferenceManager { @Override public List<NotificationPreference> getAllPreferences(DocumentReference user) throws NotificationException { Set<NotificationPreference> notificationPreferences = new HashSet<>(); for (NotificationPreferenceProvider provider : getProviders()) { notificationPreferences.addAll(provider.getPreferencesForUser(user)); } return new ArrayList<>(notificationPreferences); }  @Override List<NotificationPreference> getAllPreferences(DocumentReference user); @Override List<NotificationPreference> getAllPreferences(WikiReference wiki); @Override List<NotificationPreference> getPreferences(DocumentReference user, boolean isEnabled,
            NotificationFormat format); @Override void setStartDateForUser(DocumentReference user, Date startDate); @Override void savePreferences(List<NotificationPreference> preferences);  }### Answer:
@Test public void getNotificationPreferences() throws Exception { DocumentReference user = new DocumentReference("xwiki", "test", "user"); mockPreferenceProviders(user); List<NotificationPreference> preferences = mocker.getComponentUnderTest().getAllPreferences(user); assertEquals(4, preferences.size()); assertTrue(preferences.contains(mockPreference11)); assertTrue(preferences.contains(mockPreference12)); assertTrue(preferences.contains(mockPreference21)); assertTrue(preferences.contains(mockPreference22)); }