Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java	(revision 17712)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java	(revision 17714)
@@ -3,4 +3,6 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.time.Instant;
@@ -32,11 +34,34 @@
     public JOSMTestRules josmTestRules = new JOSMTestRules().preferences();
 
-    @Test
-    void testMultiLineNoteRendering() {
+    private Note createMultiLineNote() {
         Note note = new Note(LatLon.ZERO);
         note.setCreatedAt(Instant.now());
         note.addComment(new NoteComment(Instant.now(), User.createLocalUser(null), "foo\nbar\n\nbaz:\nfoo", null, false));
+        return note;
+    }
+
+    /**
+     * Unit test of {@link NoteRenderer}
+     */
+    @Test
+    void testMultiLineNoteRendering() {
+        Note note = createMultiLineNote();
         assertEquals("0: foo; bar; baz: foo",
                 ((JLabel) new NoteRenderer().getListCellRendererComponent(new JList<>(), note, 0, false, false)).getText());
     }
+
+    /**
+     * Unit test of {@link NotesDialog#matchesNote}
+     */
+    @Test
+    void testMatchesNote() {
+        Note note = createMultiLineNote();
+        assertTrue(NotesDialog.matchesNote(null, note));
+        assertTrue(NotesDialog.matchesNote("", note));
+        assertTrue(NotesDialog.matchesNote("foo", note));
+        assertFalse(NotesDialog.matchesNote("xxx", note));
+        assertFalse(NotesDialog.matchesNote("open", note));
+        assertFalse(NotesDialog.matchesNote("new", note));
+        assertFalse(NotesDialog.matchesNote("reopened", note));
+    }
 }
