Index: /trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 11109)
+++ /trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 11110)
@@ -5,5 +5,7 @@
 
 import java.awt.Component;
+import java.awt.GraphicsEnvironment;
 import java.io.IOException;
+import java.util.Collections;
 import java.util.List;
 
@@ -59,14 +61,13 @@
     protected void finish() {
         if (JosmUserIdentityManager.getInstance().isAnonymous()) {
-            JOptionPane.showMessageDialog(
-                    GuiHelper.getFrameForComponent(parent),
-                    "<html>" + tr("Could not retrieve the list of your open changesets because<br>"
-                            + "JOSM does not know your identity.<br>"
-                            + "You have either chosen to work anonymously or you are not entitled<br>"
-                            + "to know the identity of the user on whose behalf you are working.")
-                            + "</html>",
-                            tr("Missing user identity"),
-                            JOptionPane.ERROR_MESSAGE
-            );
+            String msg = tr("Could not retrieve the list of your open changesets because<br>"
+                    + "JOSM does not know your identity.<br>"
+                    + "You have either chosen to work anonymously or you are not entitled<br>"
+                    + "to know the identity of the user on whose behalf you are working.");
+            Main.warn(msg);
+            if (!GraphicsEnvironment.isHeadless()) {
+                JOptionPane.showMessageDialog(GuiHelper.getFrameForComponent(parent),
+                        "<html>" + msg + "</html>", tr("Missing user identity"), JOptionPane.ERROR_MESSAGE);
+            }
             return;
         }
@@ -153,6 +154,19 @@
     }
 
+    /**
+     * Determines if this task has been cancelled.
+     * @return {@code true} if this task has been cancelled
+     */
     public boolean isCanceled() {
         return canceled;
     }
+
+    /**
+     * Returns the changesets.
+     * @return the changesets, or {@code null}
+     * @since 11110
+     */
+    public final List<Changeset> getChangesets() {
+        return changesets != null ? Collections.unmodifiableList(changesets) : null;
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 11109)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 11110)
@@ -58,5 +58,5 @@
      * @return the list of changesets read from the server
      * @throws IllegalArgumentException if query is null
-     * @throws OsmTransferException if something goes wrong w
+     * @throws OsmTransferException if something goes wrong
      */
     public List<Changeset> queryChangesets(ChangesetQuery query, ProgressMonitor monitor) throws OsmTransferException {
Index: /trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(revision 11109)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(revision 11110)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -69,5 +70,8 @@
     public void testSelectTargetNode() {
         assertNull(MergeNodesAction.selectTargetNode(Collections.emptyList()));
-        assertEquals(1, MergeNodesAction.selectTargetNode(Arrays.asList(new Node(1))).getId());
+        DataSet ds = new DataSet();
+        Node n1 = new Node(1);
+        ds.addPrimitive(n1);
+        assertEquals(1, MergeNodesAction.selectTargetNode(Arrays.asList(n1)).getId());
     }
 }
Index: /trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(revision 11109)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(revision 11110)
@@ -58,6 +58,8 @@
 
             CommandStackDialog dlg = new CommandStackDialog();
-            dlg.showDialog();
+            Main.map.addToggleDialog(dlg);
+            dlg.unfurlDialog();
             assertTrue(dlg.isVisible());
+            Main.map.removeToggleDialog(dlg);
             dlg.hideDialog();
             assertFalse(dlg.isVisible());
Index: /trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java	(revision 11110)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java	(revision 11110)
@@ -0,0 +1,47 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.io;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.swing.JPanel;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.gui.JosmUserIdentityManager;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * Unit tests of {@link DownloadOpenChangesetsTask} class.
+ */
+public class DownloadOpenChangesetsTaskTest {
+
+    /**
+     * Setup tests
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
+
+    /**
+     * Test of {@link DownloadOpenChangesetsTask} class.
+     */
+    @Test
+    public void testDownloadOpenChangesetsTask() {
+        DownloadOpenChangesetsTask task = new DownloadOpenChangesetsTask(new JPanel());
+        assertNull(task.getChangesets());
+
+        assertTrue(JosmUserIdentityManager.getInstance().isAnonymous());
+        task.run();
+        assertNull(task.getChangesets());
+
+        task = new DownloadOpenChangesetsTask(new JPanel());
+        JosmUserIdentityManager.getInstance().setPartiallyIdentified(System.getProperty("osm.username", "josm_test"));
+        assertTrue(JosmUserIdentityManager.getInstance().isPartiallyIdentified());
+        task.run();
+        assertNotNull(task.getChangesets());
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 11109)
+++ /trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 11110)
@@ -269,5 +269,5 @@
 
         // TODO: Remove global listeners and other global state.
-        Main.pref.resetToInitialState();;
+        Main.pref.resetToInitialState();
         Main.platform = null;
         // Parts of JOSM uses weak references - destroy them.
