### Question:
DirectMessageStreamNotificationFilter implements NotificationFilter { @Override public ExpressionNode filterExpression(DocumentReference user, Collection<NotificationFilterPreference> filterPreferences, NotificationPreference preference) { if (user == null) { return null; } return value(EventProperty.STREAM).eq(value(user)); }  @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(); @Override int getPriority();  }### Answer:
@Test public void filterExpression() throws Exception { DocumentReference user = new DocumentReference("xwiki", "XWiki", "User"); assertEquals("STREAM = \"xwiki:XWiki.User\"", mocker.getComponentUnderTest().filterExpression(user, null, null).toString()); assertNull(mocker.getComponentUnderTest().filterExpression(null, null, null)); }