Index: trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java	(revision 9602)
+++ trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java	(revision 9602)
@@ -0,0 +1,37 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.history;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.junit.Test;
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
+import org.openstreetmap.josm.data.osm.User;
+import org.openstreetmap.josm.data.osm.history.HistoryDataSet;
+import org.openstreetmap.josm.data.osm.history.HistoryNode;
+import org.openstreetmap.josm.data.osm.history.HistoryRelation;
+import org.openstreetmap.josm.data.osm.history.HistoryWay;
+import org.openstreetmap.josm.tools.date.DateUtils;
+
+/**
+ * Unit tests of {@link HistoryBrowserDialog} class.
+ */
+public class HistoryBrowserDialogTest {
+
+    /**
+     * Test for {@link HistoryBrowserDialog#buildTitle}.
+     */
+    @Test
+    public void testBuildTitle() {
+        HistoryDataSet hds = new HistoryDataSet();
+        User user = User.createOsmUser(1, "");
+        Date date = DateUtils.fromString("2016-01-01");
+        hds.put(new HistoryNode(1, 1, true, user, 1, date, null));
+        assertEquals("History for node 1", HistoryBrowserDialog.buildTitle(hds.getHistory(1, OsmPrimitiveType.NODE)));
+        hds.put(new HistoryWay(1, 1, true, user, 1, date));
+        assertEquals("History for way 1", HistoryBrowserDialog.buildTitle(hds.getHistory(1, OsmPrimitiveType.WAY)));
+        hds.put(new HistoryRelation(1, 1, true, user, 1, date));
+        assertEquals("History for relation 1", HistoryBrowserDialog.buildTitle(hds.getHistory(1, OsmPrimitiveType.RELATION)));
+    }
+}
