Index: /trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java	(revision 9815)
+++ /trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java	(revision 9816)
@@ -55,4 +55,13 @@
     private NodeListPopupMenu popupMenu;
 
+    /**
+     * Constructs a new {@code NodeListViewer}.
+     * @param model history browser model
+     */
+    public NodeListViewer(HistoryBrowserModel model) {
+        setModel(model);
+        build();
+    }
+
     protected JScrollPane embeddInScrollPane(JTable table) {
         JScrollPane pane = new JScrollPane(table);
@@ -96,7 +105,7 @@
             public void tableChanged(TableModelEvent e) {
                 if (e.getSource() instanceof DiffTableModel) {
-                    final DiffTableModel model = (DiffTableModel) e.getSource();
-                    if (reversed == null || reversed != model.isReversed()) {
-                        reversed = model.isReversed();
+                    final DiffTableModel mod = (DiffTableModel) e.getSource();
+                    if (reversed == null || reversed != mod.isReversed()) {
+                        reversed = mod.isReversed();
                         columnModel.getColumn(0).setHeaderValue(reversed ? reversedText : nonReversedText);
                         table.getTableHeader().setToolTipText(
@@ -164,9 +173,4 @@
     }
 
-    public NodeListViewer(HistoryBrowserModel model) {
-        setModel(model);
-        build();
-    }
-
     protected void unregisterAsObserver(HistoryBrowserModel model) {
         if (currentInfoPanel != null) {
@@ -187,4 +191,8 @@
     }
 
+    /**
+     * Sets the history browser model.
+     * @param model the history browser model
+     */
     public void setModel(HistoryBrowserModel model) {
         if (this.model != null) {
@@ -231,5 +239,6 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-            if (!isEnabled()) return;
+            if (!isEnabled())
+                return;
             OsmPrimitive p = getPrimitiveToZoom();
             if (p != null) {
@@ -248,7 +257,9 @@
 
         protected OsmPrimitive getPrimitiveToZoom() {
-            if (primitiveId == null) return null;
+            if (primitiveId == null)
+                return null;
             OsmDataLayer editLayer = Main.main.getEditLayer();
-            if (editLayer == null) return null;
+            if (editLayer == null)
+                return null;
             return editLayer.data.getPrimitiveById(primitiveId);
         }
@@ -277,6 +288,7 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-            if (!isEnabled()) return;
-            run();
+            if (isEnabled()) {
+                run();
+            }
         }
 
@@ -314,6 +326,5 @@
         DiffTableModel castedModel = (DiffTableModel) model;
         Long id = (Long) castedModel.getValueAt(row, 0).value;
-        if (id == null) return null;
-        return new SimplePrimitiveId(id, OsmPrimitiveType.NODE);
+        return id == null ? null : new SimplePrimitiveId(id, OsmPrimitiveType.NODE);
     }
 
@@ -342,7 +353,9 @@
         @Override
         public void mouseClicked(MouseEvent e) {
-            if (e.getClickCount() < 2) return;
+            if (e.getClickCount() < 2)
+                return;
             int row = table.rowAtPoint(e.getPoint());
-            if (row <= 0) return;
+            if (row <= 0)
+                return;
             PrimitiveId pid = primitiveIdAtRow(table.getModel(), row);
             if (pid == null || pid.isNew())
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 9815)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 9816)
@@ -102,5 +102,5 @@
     }
 
-    public void removeProperyChangeListener(PropertyChangeListener listener) {
+    public void removePropertyChangeListener(PropertyChangeListener listener) {
         propChangeSupport.removePropertyChangeListener(listener);
     }
@@ -133,13 +133,5 @@
             throw new IndexOutOfBoundsException("unexpected rowIndex: rowIndex=" + rowIndex);
 
-        TagModel tag = tags.get(rowIndex);
-        switch(columnIndex) {
-        case 0:
-        case 1:
-            return tag;
-
-        default:
-            throw new IndexOutOfBoundsException("unexpected columnIndex: columnIndex=" + columnIndex);
-        }
+        return tags.get(rowIndex);
     }
 
@@ -147,15 +139,16 @@
     public void setValueAt(Object value, int row, int col) {
         TagModel tag = get(row);
-        if (tag == null) return;
-        switch(col) {
-        case 0:
-            updateTagName(tag, (String) value);
-            break;
-        case 1:
-            String v = (String) value;
-            if (tag.getValueCount() > 1 && !v.isEmpty()) {
-                updateTagValue(tag, v);
-            } else if (tag.getValueCount() <= 1) {
-                updateTagValue(tag, v);
+        if (tag != null) {
+            switch(col) {
+            case 0:
+                updateTagName(tag, (String) value);
+                break;
+            case 1:
+                String v = (String) value;
+                if (tag.getValueCount() > 1 && !v.isEmpty()) {
+                    updateTagValue(tag, v);
+                } else if (tag.getValueCount() <= 1) {
+                    updateTagValue(tag, v);
+                }
             }
         }
@@ -208,10 +201,10 @@
      */
     public void add(String name, String value) {
-        name = (name == null) ? "" : name;
-        value = (value == null) ? "" : value;
-
-        TagModel tag = get(name);
+        String key = (name == null) ? "" : name;
+        String val = (value == null) ? "" : value;
+
+        TagModel tag = get(key);
         if (tag == null) {
-            tag = new TagModel(name, value);
+            tag = new TagModel(key, val);
             int index = tags.size();
             while (index >= 1 && tags.get(index - 1).getName().isEmpty() && tags.get(index - 1).getValue().isEmpty()) {
@@ -220,5 +213,5 @@
             tags.add(index, tag);
         } else {
-            tag.addValue(value);
+            tag.addValue(val);
         }
         setDirty(true);
@@ -232,7 +225,7 @@
      */
     public TagModel get(String name) {
-        name = (name == null) ? "" : name;
+        String key = (name == null) ? "" : name;
         for (TagModel tag : tags) {
-            if (tag.getName().equals(name))
+            if (tag.getName().equals(key))
                 return tag;
         }
@@ -241,6 +234,5 @@
 
     public TagModel get(int idx) {
-        if (idx >= tags.size()) return null;
-        return tags.get(idx);
+        return idx >= tags.size() ? null : tags.get(idx);
     }
 
@@ -293,5 +285,6 @@
      */
     public void delete(String name) {
-        if (name == null) return;
+        if (name == null)
+            return;
         Iterator<TagModel> it = tags.iterator();
         boolean changed = false;
@@ -474,8 +467,9 @@
      */
     public boolean includesTag(String key) {
-        if (key == null) return false;
-        for (TagModel tag : tags) {
-            if (tag.getName().equals(key))
-                return true;
+        if (key != null) {
+            for (TagModel tag : tags) {
+                if (tag.getName().equals(key))
+                    return true;
+            }
         }
         return false;
@@ -502,9 +496,9 @@
         List<Command> commands = new ArrayList<>();
 
-        for (OsmPrimitive primitive : primitives) {
-            for (String oldkey : primitive.keySet()) {
+        for (OsmPrimitive prim : primitives) {
+            for (String oldkey : prim.keySet()) {
                 if (!currentkeys.contains(oldkey)) {
                     ChangePropertyCommand deleteCommand =
-                        new ChangePropertyCommand(primitive, oldkey, null);
+                        new ChangePropertyCommand(prim, oldkey, null);
                     commands.add(deleteCommand);
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TagModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TagModel.java	(revision 9815)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TagModel.java	(revision 9816)
@@ -5,4 +5,8 @@
 import java.util.List;
 
+/**
+ * Tag model.
+ * @since 1762
+ */
 public class TagModel {
 
@@ -48,9 +52,9 @@
      */
     public final void setName(String name) {
-        name = (name == null) ? "" : name;
-        this.name = name;
+        this.name = (name == null) ? "" : name;
     }
 
     /**
+     * returns the tag name (key).
      * @return the tag name
      */
@@ -71,25 +75,27 @@
      */
     public final void setValue(String value) {
-        value = (value == null) ? "" : value;
         clearValues();
-        this.values.add(value);
+        this.values.add((value == null) ? "" : value);
     }
 
     /**
-     *
+     * determines if this tag model has a specific value
      * @param value the value to be checked; converted to "" if null
      * @return true, if the values of this tag include <code>value</code>; false otherwise
      */
     public boolean hasValue(String value) {
-        value = (value == null) ? "" : value;
-        return values.contains(value);
+        return values.contains((value == null) ? "" : value);
     }
 
+    /**
+     * adds a tag value
+     * @param value the value to add; converted to "" if null
+     */
     public void addValue(String value) {
-        value = (value == null) ? "" : value;
-        if (hasValue(value)) {
+        String val = (value == null) ? "" : value;
+        if (hasValue(val)) {
             return;
         }
-        values.add(value);
+        values.add(val);
     }
 
@@ -99,12 +105,19 @@
      */
     public void removeValue(String value) {
-        value = (value == null) ? "" : value;
-        values.remove(value);
+        values.remove((value == null) ? "" : value);
     }
 
+    /**
+     * returns the list of values
+     * @return the list of values
+     */
     public List<String> getValues() {
         return values;
     }
 
+    /**
+     * returns the value(s) as string
+     * @return the value(s) as string, joined with a semicolon (;) if multiple values
+     */
     public String getValue() {
         if (getValueCount() == 0) {
@@ -124,4 +137,8 @@
     }
 
+    /**
+     * returns the number of values
+     * @return the number of values
+     */
     public int getValueCount() {
         return values.size();
Index: /trunk/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java	(revision 9816)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java	(revision 9816)
@@ -0,0 +1,28 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.history;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+
+/**
+ * Unit tests of {@link NodeListViewer} class.
+ */
+public class NodeListViewerTest {
+
+    /**
+     * Test for {@link NodeListViewer#NodeListViewer} - {@code null} handling.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testNodeListViewerNull() {
+        new NodeListViewer(null);
+    }
+
+    /**
+     * Test for {@link NodeListViewer#NodeListViewer} - nominal case.
+     */
+    @Test
+    public void testNodeListViewerNominal() {
+        assertNotNull(new NodeListViewer(new HistoryBrowserModel()));
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/io/UploadPrimitivesTaskTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/io/UploadPrimitivesTaskTest.java	(revision 9816)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/io/UploadPrimitivesTaskTest.java	(revision 9816)
@@ -0,0 +1,37 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.io;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.osm.Changeset;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+/**
+ * Unit tests of {@link UploadPrimitivesTask} class.
+ */
+public class UploadPrimitivesTaskTest {
+
+    /**
+     * Setup tests
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Test of {@link UploadPrimitivesTask#UploadPrimitivesTask}.
+     */
+    @Test
+    public void testUploadPrimitivesTask() {
+        assertNotNull(new UploadPrimitivesTask(
+                new UploadStrategySpecification(),
+                new OsmDataLayer(new DataSet(), null, null),
+                null,
+                new Changeset()));
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 9816)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 9816)
@@ -0,0 +1,36 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.layer.gpx;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.data.gpx.GpxData;
+import org.openstreetmap.josm.gui.layer.GpxLayer;
+import org.openstreetmap.josm.io.GpxReaderTest;
+
+/**
+ * Unit tests of {@link ChooseTrackVisibilityAction} class.
+ */
+public class ChooseTrackVisibilityActionTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Test action.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testAction() throws Exception {
+        final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "minimal.gpx");
+        GpxLayer gpxLayer = new GpxLayer(gpx);
+        ChooseTrackVisibilityAction action = new ChooseTrackVisibilityAction(gpxLayer);
+        action.actionPerformed(null);
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 9816)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 9816)
@@ -0,0 +1,48 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.layer.gpx;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.data.gpx.GpxData;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.io.GpxReaderTest;
+
+/**
+ * Unit tests of {@link DownloadAlongTrackAction} class.
+ */
+public class DownloadAlongTrackActionTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init(true);
+    }
+
+    /**
+     * Test action.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testDownload() throws Exception {
+        final OsmDataLayer layer = new OsmDataLayer(new DataSet(), getClass().getName(), null);
+        try {
+            Main.main.addLayer(layer);
+            // Perform action
+            final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "minimal.gpx");
+            PleaseWaitRunnable task = new DownloadAlongTrackAction(gpx).createTask();
+            assertNotNull(task);
+        } finally {
+            // Ensure we clean the place before leaving, even if test fails.
+            Main.main.removeLayer(layer);
+        }
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagEditorModelTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagEditorModelTest.java	(revision 9816)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagEditorModelTest.java	(revision 9816)
@@ -0,0 +1,31 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.tagging;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+/**
+ * Unit tests of {@link TagEditorModel} class.
+ */
+public class TagEditorModelTest {
+
+    /**
+     * Unit test of {@link TagEditorModel#TagEditorModel}.
+     */
+    @Test
+    public void testTagEditorModel() {
+        TagEditorModel tem = new TagEditorModel();
+        tem.add(null, null);
+        assertEquals(1, tem.getRowCount());
+        assertEquals(2, tem.getColumnCount());
+        tem.add("key", "val");
+        assertEquals(2, tem.getRowCount());
+        assertEquals(2, tem.getColumnCount());
+        tem.delete(null);
+        tem.delete("");
+        assertEquals(1, tem.getRowCount());
+        tem.delete("key");
+        assertEquals(0, tem.getRowCount());
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagModelTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagModelTest.java	(revision 9816)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagModelTest.java	(revision 9816)
@@ -0,0 +1,73 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.tagging;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+/**
+ * Unit tests of {@link TagModel} class.
+ */
+public class TagModelTest {
+
+    /**
+     * Unit test of {@link TagModel#TagModel} - single value.
+     */
+    @Test
+    public void testTagModelSingleValue() {
+        TagModel tm = new TagModel();
+        assertEquals("", tm.getName());
+        assertEquals("", tm.getValue());
+        assertEquals(1, tm.getValueCount());
+        assertTrue(tm.hasValue(null));
+        assertTrue(tm.hasValue(""));
+
+        tm.clearValues();
+        assertEquals(0, tm.getValueCount());
+        assertEquals("", tm.getValue());
+
+        tm.setValue(null);
+        assertEquals(1, tm.getValueCount());
+        assertEquals("", tm.getValue());
+
+        tm = new TagModel("key");
+        assertEquals("key", tm.getName());
+        assertEquals("", tm.getValue());
+        assertEquals(1, tm.getValueCount());
+        assertTrue(tm.hasValue(""));
+    }
+
+    /**
+     * Unit test of {@link TagModel#TagModel} - multiple values.
+     */
+    @Test
+    public void testTagModelMultipleValues() {
+        TagModel tm = new TagModel("key2", "val2");
+        assertEquals("key2", tm.getName());
+        assertEquals("val2", tm.getValue());
+        assertEquals(1, tm.getValueCount());
+        assertTrue(tm.hasValue("val2"));
+
+        tm.setName("key3");
+        tm.setValue("val3");
+        assertEquals("key3", tm.getName());
+        assertEquals("val3", tm.getValue());
+        assertEquals(1, tm.getValueCount());
+        assertTrue(tm.hasValue("val3"));
+
+        tm.addValue("val4");
+        tm.addValue("val4");
+        assertEquals(2, tm.getValueCount());
+        assertEquals("val3;val4", tm.getValue());
+
+        tm.removeValue("something");
+        tm.removeValue(null);
+        assertEquals(2, tm.getValueCount());
+        assertEquals("val3;val4", tm.getValue());
+
+        tm.removeValue("val3");
+        assertEquals(1, tm.getValueCount());
+        assertEquals("val4", tm.getValue());
+    }
+}
