@Test public void matchesPreference() throws Exception { NotificationPreference notificationPreference = mock(NotificationPreference.class); Map<NotificationPreferenceProperty, Object> properties = new HashMap<>(); properties.put(NotificationPreferenceProperty.EVENT_TYPE, "personalMessage"); when(notificationPreference.getProperties()).thenReturn(properties); assertTrue(mocker.getComponentUnderTest().matchesPreference(notificationPreference)); NotificationPreference notificationPreference2 = mock(NotificationPreference.class); Map<NotificationPreferenceProperty, Object> properties2 = new HashMap<>(); properties2.put(NotificationPreferenceProperty.EVENT_TYPE, "otherEventType"); when(notificationPreference2.getProperties()).thenReturn(properties2); assertFalse(mocker.getComponentUnderTest().matchesPreference(notificationPreference2)); }
@Override public boolean matchesPreference(NotificationPreference preference) { return PersonalMessageDescriptor.EVENT_TYPE.equals(getEventType(preference)); }
PersonalMessageStreamNotificationFilter implements NotificationFilter { @Override public boolean matchesPreference(NotificationPreference preference) { return PersonalMessageDescriptor.EVENT_TYPE.equals(getEventType(preference)); } }
PersonalMessageStreamNotificationFilter implements NotificationFilter { @Override public boolean matchesPreference(NotificationPreference preference) { return PersonalMessageDescriptor.EVENT_TYPE.equals(getEventType(preference)); }  }
PersonalMessageStreamNotificationFilter implements NotificationFilter { @Override public boolean matchesPreference(NotificationPreference preference) { return PersonalMessageDescriptor.EVENT_TYPE.equals(getEventType(preference)); }  @Override FilterPolicy filterEvent(Event event, DocumentReference user,
            Collection<NotificationFilterPreference> filterPreferences, NotificationFormat format); @Override boolean matchesPreference(NotificationPreference preference); @Override ExpressionNode filterExpression(DocumentReference user,
            Collection<NotificationFilterPreference> filterPreferences, NotificationPreference preference); @Override ExpressionNode filterExpression(DocumentReference user,
            Collection<NotificationFilterPreference> filterPreferences, NotificationFilterType type,
            NotificationFormat format); @Override String getName(); }
PersonalMessageStreamNotificationFilter implements NotificationFilter { @Override public boolean matchesPreference(NotificationPreference preference) { return PersonalMessageDescriptor.EVENT_TYPE.equals(getEventType(preference)); }  @Override FilterPolicy filterEvent(Event event, DocumentReference user,
            Collection<NotificationFilterPreference> filterPreferences, NotificationFormat format); @Override boolean matchesPreference(NotificationPreference preference); @Override ExpressionNode filterExpression(DocumentReference user,
            Collection<NotificationFilterPreference> filterPreferences, NotificationPreference preference); @Override ExpressionNode filterExpression(DocumentReference user,
            Collection<NotificationFilterPreference> filterPreferences, NotificationFilterType type,
            NotificationFormat format); @Override String getName();  }