Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java	(revision 11114)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java	(revision 11115)
@@ -7,6 +7,9 @@
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
+import org.junit.Assert;
 import org.junit.Test;
 import org.openstreetmap.josm.TestUtils;
@@ -180,3 +183,34 @@
         cache.removeChangesetCacheListener(listener);
     }
+
+    /**
+     * Unit test of method {@link ChangesetCache#getOpenChangesets}.
+     */
+    @Test
+    public void testGetOpenChangesets() {
+        final ChangesetCache cache = ChangesetCache.getInstance();
+        // empty cache => empty list
+        Assert.assertTrue(
+                "Empty cache should produce an empty list.",
+                cache.getOpenChangesets().isEmpty()
+        );
+
+        // cache with only closed changesets => empty list
+        Changeset closedCs = new Changeset(1);
+        closedCs.setOpen(false);
+        cache.update(closedCs);
+        Assert.assertTrue(
+                "Cache with only closed changesets should produce an empty list.",
+                cache.getOpenChangesets().isEmpty()
+        );
+
+        // cache with open and closed changesets => list with only the open ones
+        Changeset openCs = new Changeset(2);
+        openCs.setOpen(true);
+        cache.update(openCs);
+        Assert.assertEquals(
+                Collections.singletonList(openCs),
+                cache.getOpenChangesets()
+        );
+    }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java	(revision 11115)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java	(revision 11115)
@@ -0,0 +1,64 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.Assert;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import java.util.Date;
+import java.util.Set;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.history.HistoryNode;
+import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
+
+/**
+ * Unit tests for class {@link ChangesetDataSet}.
+ */
+public class ChangesetDataSetTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of method {@link ChangesetDataSet#getPrimitivesByModificationType}.
+     */
+    @Test
+    public void testGetPrimitivesByModificationType() {
+        final ChangesetDataSet cds = new ChangesetDataSet();
+        // empty object, null parameter => IllegalArgumentException
+        try {
+            cds.getPrimitivesByModificationType(null);
+            Assert.fail("Should have thrown an IllegalArgumentException as we gave a null argument.");
+        } catch (IllegalArgumentException e) {
+            // Was expected
+        }
+        
+        // empty object, a modification type => empty list
+        Assert.assertTrue(
+            "Empty data set should produce an empty list.",
+            cds.getPrimitivesByModificationType(
+                    ChangesetModificationType.CREATED).isEmpty()
+        );
+        
+        // object with various items and modification types, fetch for CREATED
+        // => list containing only the CREATED item
+        HistoryOsmPrimitive prim1 = new HistoryNode(1, 1, true, User.getAnonymous(), 1, new Date(), LatLon.ZERO);
+        HistoryOsmPrimitive prim2 = new HistoryNode(2, 1, true, User.createLocalUser("test"), 1, new Date(), LatLon.NORTH_POLE);
+        HistoryOsmPrimitive prim3 = new HistoryNode(3, 1, true, User.getAnonymous(), 1, new Date(), LatLon.SOUTH_POLE);
+        cds.put(prim1, ChangesetModificationType.CREATED);
+        cds.put(prim2, ChangesetModificationType.DELETED);
+        cds.put(prim3, ChangesetModificationType.UPDATED);
+        Set<HistoryOsmPrimitive> result = cds.getPrimitivesByModificationType(
+                    ChangesetModificationType.CREATED);
+        Assert.assertEquals("We should have found only one item.", 1, result.size());
+        Assert.assertTrue("The item found is prim1.", result.contains(prim1));
+        
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 11115)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 11115)
@@ -0,0 +1,66 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Assert;
+import static org.openstreetmap.josm.data.osm.Changeset.MAX_CHANGESET_TAG_LENGTH;
+
+/**
+ * Unit tests for class {@link Changeset}.
+ */
+public class ChangesetTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of method {@link Changeset#setKeys}.
+     */
+    @Test
+    public void testSetKeys() {
+        final Changeset cs = new Changeset();
+        // Cannot add null map => IllegalArgumentException
+        try {
+            cs.setKeys(null);
+            Assert.fail("Should have thrown an IllegalArgumentException as we gave a null argument.");
+        } catch (IllegalArgumentException e) {
+            // Was expected
+        }
+        
+        // Add a map with no values
+        // => the key list is empty
+        Map<String, String> keys = new HashMap<>();
+        
+        // Add a map with valid values : null and short texts
+        // => all the items are in the keys
+        keys.put("empty", null);
+        keys.put("test", "test");
+        cs.setKeys(keys);
+        Assert.assertEquals("Both valid keys should have been put in the ChangeSet.", 2, cs.getKeys().size());
+        
+        // Add a map with too long values => IllegalArgumentException
+        keys = new HashMap<>();
+        StringBuilder b = new StringBuilder(MAX_CHANGESET_TAG_LENGTH + 1);
+        for (int i = 0; i < MAX_CHANGESET_TAG_LENGTH + 1; i++){
+           b.append("x");
+        }
+        keys.put("test", b.toString());
+        try {
+            cs.setKeys(keys);
+            Assert.fail("Should have thrown an IllegalArgumentException as we gave a too long value.");
+        } catch (IllegalArgumentException e) {
+            // Was expected
+        }
+                
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java	(revision 11115)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java	(revision 11115)
@@ -0,0 +1,57 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.Assert;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import java.util.List;
+import org.openstreetmap.josm.data.coor.LatLon;
+
+/**
+ * Unit tests for class {@link DataSet}.
+ */
+public class DataSetTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of method {@link DataSet#searchRelations}.
+     */
+    @Test
+    public void testSearchRelations() {
+        final DataSet ds = new DataSet();
+        // null bbox => empty list
+        Assert.assertTrue(
+            "Empty data set should produce an empty list.",
+            ds.searchRelations(null).isEmpty()
+        );
+        
+        // empty data set, any bbox => empty list
+        BBox bbox = new BBox(LatLon.NORTH_POLE, LatLon.SOUTH_POLE);
+        Assert.assertTrue(
+            "Empty data set should produce an empty list.",
+            ds.searchRelations(bbox).isEmpty()
+        );
+        
+        // data set with elements in the given bbox => these elements
+        Node node = new Node(LatLon.ZERO);
+        Relation r = new Relation(1);
+        RelationMember rm = new RelationMember("role", node);
+        r.addMember(rm);
+        ds.addPrimitive(node);
+        ds.addPrimitive(r);
+        bbox = new BBox(new LatLon(-1.0, -1.0), new LatLon(1.0, 1.0));
+        List<Relation> result = ds.searchRelations(bbox);
+        Assert.assertEquals("We should have found only one item.", 1, result.size());
+        Assert.assertTrue("The item found is relation r.", result.contains(r));
+        
+    }
+}
