Index: trunk/test/unit/org/openstreetmap/josm/data/notes/NoteCommentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/notes/NoteCommentTest.java	(revision 10098)
+++ trunk/test/unit/org/openstreetmap/josm/data/notes/NoteCommentTest.java	(revision 10098)
@@ -0,0 +1,38 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.notes;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Date;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+
+/**
+ * Unit tests for class {@link NoteComment}.
+ */
+public class NoteCommentTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void init() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of {@link NoteComment} class.
+     */
+    @Test
+    public void testNoteComment() {
+        NoteComment comment = new NoteComment(new Date(), null, "foo", null, true);
+        assertEquals("foo", comment.toString());
+        assertTrue(comment.isNew());
+        comment.setNew(false);
+        assertFalse(comment.isNew());
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/notes/NoteTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/notes/NoteTest.java	(revision 10098)
+++ trunk/test/unit/org/openstreetmap/josm/data/notes/NoteTest.java	(revision 10098)
@@ -0,0 +1,69 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.notes;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+import java.util.Date;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.coor.LatLon;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+/**
+ * Unit tests for class {@link NoteComment}.
+ */
+public class NoteTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void init() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of {@link Note#toString} method.
+     */
+    @Test
+    public void testToString() {
+        Note note = new Note(LatLon.ZERO);
+        assertEquals("Note 0: null", note.toString());
+        note.addComment(new NoteComment(new Date(), null, "foo", null, true));
+        assertEquals("Note 0: foo", note.toString());
+    }
+
+    /**
+     * Unit test of {@link Note#updateWith} method.
+     */
+    @Test
+    public void testUpdateWith() {
+        Note n1 = new Note(LatLon.ZERO);
+        n1.setId(1);
+        Note n2 = new Note(LatLon.ZERO);
+        n1.setId(2);
+        assertNotEquals(n1, n2);
+        n1.updateWith(n2);
+        assertEquals(n1, n2);
+    }
+
+    /**
+     * Unit test of methods {@link Note#equals} and {@link Note#hashCode}.
+     */
+    @Test
+    public void equalsContract() {
+        EqualsVerifier.forClass(Note.class).usingGetClass()
+            .withIgnoredFields("latLon", "createdAt", "closedAt", "state", "comments")
+            .suppress(Warning.NONFINAL_FIELDS)
+            .withPrefabValues(LatLon.class, LatLon.ZERO, new LatLon(1, 1))
+            .withPrefabValues(NoteComment.class,
+                    new NoteComment(new Date(), null, "foo", null, true),
+                    new NoteComment(new Date(), null, "bar", null, false))
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java	(revision 10097)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java	(revision 10098)
@@ -40,4 +40,5 @@
             assertEquals(tabPane.getSetting(parentClass), ((SubPreferenceSetting) setting).getTabPreferenceSetting(tabPane));
         }
+        setting.ok();
     }
 }
