Index: /trunk/src/org/openstreetmap/josm/data/osm/DataIntegrityProblemException.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DataIntegrityProblemException.java	(revision 12035)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DataIntegrityProblemException.java	(revision 12036)
@@ -2,12 +2,25 @@
 package org.openstreetmap.josm.data.osm;
 
+/**
+ * Exception thrown when a primitive or data set does not pass its integrity checks.
+ * @since 2399
+ */
 public class DataIntegrityProblemException extends RuntimeException {
 
     private final String htmlMessage;
 
+    /**
+     * Constructs a new {@code DataIntegrityProblemException}.
+     * @param message the detail message
+     */
     public DataIntegrityProblemException(String message) {
         this(message, null);
     }
 
+    /**
+     * Constructs a new {@code DataIntegrityProblemException}.
+     * @param message the detail message
+     * @param htmlMessage HTML-formatted error message. Can be null
+     */
     public DataIntegrityProblemException(String message, String htmlMessage) {
         super(message);
@@ -15,4 +28,8 @@
     }
 
+    /**
+     * Returns the HTML-formatted error message.
+     * @return the HTML-formatted error message, or null
+     */
     public String getHtmlMessage() {
         return htmlMessage;
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/DataIntegrityProblemExceptionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/DataIntegrityProblemExceptionTest.java	(revision 12036)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/DataIntegrityProblemExceptionTest.java	(revision 12036)
@@ -0,0 +1,37 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * Unit tests for class {@link DataIntegrityProblemException}.
+ */
+public class DataIntegrityProblemExceptionTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of {@link DataIntegrityProblemException} constructor.
+     */
+    @Test
+    public void testDataIntegrityException() {
+        DataIntegrityProblemException e1 = new DataIntegrityProblemException("foo");
+        assertEquals("foo", e1.getMessage());
+        assertNull(e1.getHtmlMessage());
+        DataIntegrityProblemException e2 = new DataIntegrityProblemException("foo", "<html>bar</html>");
+        assertEquals("foo", e2.getMessage());
+        assertEquals("<html>bar</html>", e2.getHtmlMessage());
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java	(revision 12035)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java	(revision 12036)
@@ -2,5 +2,9 @@
 package org.openstreetmap.josm.data.osm;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 
@@ -58,4 +62,47 @@
 
     /**
+     * Unit test of methods {@link DataSet#addChangeSetTag} / {@link DataSet#getChangeSetTags}.
+     */
+    @Test
+    public void testChangesetTags() {
+        final DataSet ds = new DataSet();
+        assertTrue(ds.getChangeSetTags().isEmpty());
+        ds.addChangeSetTag("foo", "bar");
+        assertEquals("bar", ds.getChangeSetTags().get("foo"));
+    }
+
+    /**
+     * Unit test of methods {@link DataSet#allNonDeletedPrimitives}
+     *                    / {@link DataSet#allNonDeletedCompletePrimitives}
+     *                    / {@link DataSet#allNonDeletedPhysicalPrimitives}.
+     */
+    @Test
+    public void testAllNonDeleted() {
+        final DataSet ds = new DataSet();
+        assertTrue(ds.allNonDeletedPrimitives().isEmpty());
+        assertTrue(ds.allNonDeletedCompletePrimitives().isEmpty());
+        assertTrue(ds.allNonDeletedPhysicalPrimitives().isEmpty());
+
+        Node n1 = new Node(1); n1.setCoor(LatLon.NORTH_POLE); n1.setDeleted(true); n1.setIncomplete(false); ds.addPrimitive(n1);
+        Node n2 = new Node(2); n2.setCoor(LatLon.NORTH_POLE); n2.setDeleted(false); n2.setIncomplete(false); ds.addPrimitive(n2);
+        Node n3 = new Node(3); n3.setCoor(LatLon.NORTH_POLE); n3.setDeleted(false); n3.setIncomplete(true); ds.addPrimitive(n3);
+
+        Way w1 = new Way(1); w1.setDeleted(true); w1.setIncomplete(false); ds.addPrimitive(w1);
+        Way w2 = new Way(2); w2.setDeleted(false); w2.setIncomplete(false); ds.addPrimitive(w2);
+        Way w3 = new Way(3); w3.setDeleted(false); w3.setIncomplete(true); ds.addPrimitive(w3);
+
+        Relation r1 = new Relation(1); r1.setDeleted(true); r1.setIncomplete(false); ds.addPrimitive(r1);
+        Relation r2 = new Relation(2); r2.setDeleted(false); r2.setIncomplete(false); ds.addPrimitive(r2);
+        Relation r3 = new Relation(3); r3.setDeleted(false); r3.setIncomplete(true); ds.addPrimitive(r3);
+
+        assertEquals(new HashSet<>(Arrays.asList(n2, n3, w2, w3, r2, r3)),
+                new HashSet<>(ds.allNonDeletedPrimitives()));
+        assertEquals(new HashSet<>(Arrays.asList(n2, w2, r2)),
+                new HashSet<>(ds.allNonDeletedCompletePrimitives()));
+        assertEquals(new HashSet<>(Arrays.asList(n2, w2)),
+                new HashSet<>(ds.allNonDeletedPhysicalPrimitives()));
+    }
+
+    /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/14186">Bug #14186</a>.
      */
