Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java	(revision 8907)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java	(revision 8908)
@@ -9,10 +9,12 @@
 /**
  * Common abstract implementation of other download tasks
+ * @param <T> The downloaded data type
  * @since 2322
  */
-public abstract class AbstractDownloadTask implements DownloadTask {
+public abstract class AbstractDownloadTask<T> implements DownloadTask {
     private List<Object> errorMessages;
     private boolean canceled;
     private boolean failed;
+    protected T downloadedData;
 
     public AbstractDownloadTask() {
@@ -36,10 +38,22 @@
     }
 
-    protected void rememberErrorMessage(String message) {
+    protected final void rememberErrorMessage(String message) {
         errorMessages.add(message);
     }
 
-    protected void rememberException(Exception exception) {
+    protected final void rememberException(Exception exception) {
         errorMessages.add(exception);
+    }
+
+    protected final void rememberDownloadedData(T data) {
+        this.downloadedData = data;
+    }
+
+    /**
+     * Replies the downloaded data.
+     * @return The downloaded data.
+     */
+    public final T getDownloadedData() {
+        return downloadedData;
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java	(revision 8907)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java	(revision 8908)
@@ -33,5 +33,5 @@
  * Task allowing to download GPS data.
  */
-public class DownloadGpsTask extends AbstractDownloadTask {
+public class DownloadGpsTask extends AbstractDownloadTask<GpxData> {
 
     private DownloadTask downloadTask;
@@ -128,4 +128,5 @@
         @Override
         protected void finish() {
+            rememberDownloadedData(rawData);
             if (isCanceled() || isFailed())
                 return;
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java	(revision 8907)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java	(revision 8908)
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.notes.Note;
+import org.openstreetmap.josm.data.osm.NoteData;
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -27,5 +28,5 @@
 
 /** Task for downloading notes */
-public class DownloadNotesTask extends AbstractDownloadTask {
+public class DownloadNotesTask extends AbstractDownloadTask<NoteData> {
 
     private static final String PATTERN_API_URL = "https?://.*/api/0.6/notes.*";
@@ -38,4 +39,10 @@
     private DownloadTask downloadTask;
 
+    /**
+     * Download a specific note by its id.
+     * @param id Note identifier
+     * @param progressMonitor progress monitor
+     * @return the future representing the asynchronous task
+     */
     public Future<?> download(long id, ProgressMonitor progressMonitor) {
         final String url = OsmApi.getOsmApi().getBaseUrl() + "notes/" + id;
@@ -98,4 +105,5 @@
         @Override
         protected void finish() {
+            rememberDownloadedData(new NoteData(notesData));
             if (isCanceled() || isFailed()) {
                 return;
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 8907)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 8908)
@@ -36,5 +36,5 @@
  * Run in the worker thread.
  */
-public class DownloadOsmTask extends AbstractDownloadTask {
+public class DownloadOsmTask extends AbstractDownloadTask<DataSet> {
 
     protected static final String PATTERN_OSM_API_URL           = "https?://.*/api/0.6/(map|nodes?|ways?|relations?|\\*).*";
@@ -44,5 +44,4 @@
 
     protected Bounds currentBounds;
-    protected DataSet downloadedData;
     protected DownloadTask downloadTask;
 
@@ -66,16 +65,4 @@
             return super.getTitle();
         }
-    }
-
-    protected void rememberDownloadedData(DataSet ds) {
-        this.downloadedData = ds;
-    }
-
-    /**
-     * Replies the {@link DataSet} containing the downloaded OSM data.
-     * @return The {@link DataSet} containing the downloaded OSM data.
-     */
-    public DataSet getDownloadedData() {
-        return downloadedData;
     }
 
Index: /trunk/test/data/planet-notes-extract.osn
===================================================================
--- /trunk/test/data/planet-notes-extract.osn	(revision 8908)
+++ /trunk/test/data/planet-notes-extract.osn	(revision 8908)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<osm-notes>
+<note id="4" lat="36.7232991" lon="68.8641500" created_at="2013-04-24T08:07:02Z" closed_at="2013-04-24T08:08:51Z">
+  <comment action="opened" timestamp="2013-04-24T08:07:02Z" uid="1626" user="FredB">test</comment>
+  <comment action="closed" timestamp="2013-04-24T08:08:51Z" uid="1626" user="FredB"></comment>
+</note>
+<note id="5" lat="51.7609210" lon="-0.0112063" created_at="2013-04-24T08:10:38Z" closed_at="2013-04-24T21:31:47Z">
+  <comment action="opened" timestamp="2013-04-24T08:10:38Z" uid="3980" user="TomH">This building has been demolished and is currently a construction site.</comment>
+  <comment action="closed" timestamp="2013-04-24T21:31:47Z" uid="3980" user="TomH"></comment>
+</note>
+<note id="6" lat="35.5170066" lon="139.6322554" created_at="2013-04-24T08:12:38Z" closed_at="2013-05-10T12:28:11Z">
+  <comment action="opened" timestamp="2013-04-24T08:12:38Z" uid="378532" user="nyampire">Ministopは閉店済み</comment>
+  <comment action="closed" timestamp="2013-05-10T12:28:11Z" uid="10353" user="gorn">name corrected</comment>
+</note>
+<note id="7" lat="50.9381992" lon="1.8605947" created_at="2013-04-24T08:14:28Z" closed_at="2013-04-24T08:14:50Z">
+  <comment action="opened" timestamp="2013-04-24T08:14:28Z">Adresse complète :
+B&amp;B CALAIS Centre St Pierre 	 
+ZAC Curie
+Rue de Lille
+62100 CALAIS
+Tel. 08 92 70 75 18 (0.34€ TTC/mn depuis un poste fixe)
+Fax. 03 21 00 92 71
+Parking, accès handicapé, wifi, ascenseur, caméra</comment>
+  <comment action="closed" timestamp="2013-04-24T08:14:50Z" uid="37548" user="Marcussacapuces91"></comment>
+</note>
+<note id="289379" lat="50.3699789" lon="8.6278027" created_at="2014-12-21T01:30:26Z">
+  <comment action="opened" timestamp="2014-12-21T01:30:26Z">Freizeitheim Uhu</comment>
+</note>
+<note id="289380" lat="48.5979475" lon="-2.1622145" created_at="2014-12-21T01:51:36Z">
+  <comment action="opened" timestamp="2014-12-21T01:51:36Z">parking</comment>
+</note>
+<note id="289381" lat="49.8535075" lon="20.9857535" created_at="2014-12-21T02:14:51Z" closed_at="2014-12-21T02:16:33Z">
+  <comment action="opened" timestamp="2014-12-21T02:14:51Z">to nie ścieżka</comment>
+  <comment action="closed" timestamp="2014-12-21T02:16:33Z" uid="163896" user="Zbigniew_Czernik">zgadza się</comment>
+</note>
+<note id="289382" lat="49.8537980" lon="20.9873736" created_at="2014-12-21T02:15:04Z">
+  <comment action="opened" timestamp="2014-12-21T02:15:04Z">to nie ścieżka</comment>
+</note>
+<note id="289383" lat="49.8525390" lon="20.9827387" created_at="2014-12-21T02:15:23Z" closed_at="2014-12-21T02:18:01Z">
+  <comment action="opened" timestamp="2014-12-21T02:15:23Z">o to za droga i dlaczego brak jej oznaczenia w legendzie?</comment>
+  <comment action="closed" timestamp="2014-12-21T02:18:01Z" uid="163896" user="Zbigniew_Czernik">bo legenda jest stara i nieaktualna. To jest droga lokalna.</comment>
+</note>
+</osm-notes>
Index: /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTaskTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTaskTest.java	(revision 8907)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTaskTest.java	(revision 8908)
@@ -3,4 +3,5 @@
 
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
@@ -10,4 +11,5 @@
 import org.junit.Test;
 import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.gpx.GpxData;
 
 /**
@@ -51,4 +53,8 @@
         DownloadGpsTask task = new DownloadGpsTask();
         task.loadUrl(false, REMOTE_FILE, null).get();
+        GpxData data = task.getDownloadedData();
+        assertNotNull(data);
+        assertFalse(data.waypoints.isEmpty());
+        assertFalse(data.tracks.isEmpty());
     }
 }
Index: /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTaskTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTaskTest.java	(revision 8908)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTaskTest.java	(revision 8908)
@@ -0,0 +1,58 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions.downloadtasks;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.concurrent.ExecutionException;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.osm.NoteData;
+
+/**
+ * Unit tests for class {@link DownloadNotesTask}.
+ */
+public class DownloadNotesTaskTest {
+
+    private static final String REMOTE_FILE = "https://josm.openstreetmap.de/export/head/josm/trunk/test/data/planet-notes-extract.osn";
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUp() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of {@code DownloadNotesTask#acceptsUrl} method.
+     */
+    @Test
+    public void testAcceptsURL() {
+        DownloadNotesTask task = new DownloadNotesTask();
+        assertFalse(task.acceptsUrl(null));
+        assertFalse(task.acceptsUrl(""));
+        assertTrue(task.acceptsUrl("http://api.openstreetmap.org/api/0.6/notes?bbox=-0.65094,51.312159,0.374908,51.669148"));
+        assertTrue(task.acceptsUrl("http://api.openstreetmap.org/api/0.6/notes.json?bbox=-0.65094,51.312159,0.374908,51.669148"));
+        assertTrue(task.acceptsUrl("http://api.openstreetmap.org/api/0.6/notes.xml?bbox=-0.65094,51.312159,0.374908,51.669148"));
+        assertTrue(task.acceptsUrl("http://api.openstreetmap.org/api/0.6/notes.gpx?bbox=-0.65094,51.312159,0.374908,51.669148"));
+        assertTrue(task.acceptsUrl(REMOTE_FILE));
+    }
+
+    /**
+     * Unit test of {@code DownloadNotesTask#loadUrl} method with an external file.
+     * @throws ExecutionException if the computation threw an exception
+     * @throws InterruptedException if the current thread was interrupted while waiting
+     */
+    @Test
+    public void testDownloadExternalFile() throws InterruptedException, ExecutionException {
+        DownloadNotesTask task = new DownloadNotesTask();
+        task.loadUrl(false, REMOTE_FILE, null).get();
+        NoteData data = task.getDownloadedData();
+        assertNotNull(data);
+        assertFalse(data.getNotes().isEmpty());
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskTest.java	(revision 8907)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskTest.java	(revision 8908)
@@ -3,4 +3,5 @@
 
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
@@ -10,4 +11,5 @@
 import org.junit.Test;
 import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.osm.DataSet;
 
 /**
@@ -52,4 +54,8 @@
         DownloadOsmTask task = new DownloadOsmTask();
         task.loadUrl(false, REMOTE_FILE, null).get();
+        DataSet ds = task.getDownloadedData();
+        assertNotNull(ds);
+        assertFalse(ds.getNodes().isEmpty());
+        assertFalse(ds.getWays().isEmpty());
     }
 }
