Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollection.java	(revision 9939)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollection.java	(revision 9939)
@@ -0,0 +1,57 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.dialogs.properties;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.openstreetmap.josm.data.osm.Tag;
+import org.openstreetmap.josm.data.preferences.CollectionProperty;
+
+class RecentTagCollection {
+
+    private final Map<Tag, Void> recentTags;
+
+    RecentTagCollection(final int capacity) {
+        // LRU cache for recently added tags (http://java-planet.blogspot.com/2005/08/how-to-set-up-simple-lru-cache-using.html)
+        recentTags = new LinkedHashMap<Tag, Void>(capacity + 1, 1.1f, true) {
+            @Override
+            protected boolean removeEldestEntry(Map.Entry<Tag, Void> eldest) {
+                return size() > capacity;
+            }
+        };
+    }
+
+    public void loadFromPreference(CollectionProperty property) {
+        recentTags.clear();
+        Iterator<String> it = property.get().iterator();
+        while (it.hasNext()) {
+            String key = it.next();
+            String value = it.next();
+            recentTags.put(new Tag(key, value), null);
+        }
+    }
+
+    public void saveToPreference(CollectionProperty property) {
+        List<String> c = new ArrayList<>(recentTags.size() * 2);
+        for (Tag t : recentTags.keySet()) {
+            c.add(t.getKey());
+            c.add(t.getValue());
+        }
+        property.put(c);
+    }
+
+    public void add(Tag key) {
+        recentTags.put(key, null);
+    }
+
+    public boolean isEmpty() {
+        return recentTags.isEmpty();
+    }
+
+    public List<Tag> toList() {
+        return new ArrayList<>(recentTags.keySet());
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 9937)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 9939)
@@ -35,6 +35,4 @@
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -70,4 +68,5 @@
 import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.data.preferences.BooleanProperty;
+import org.openstreetmap.josm.data.preferences.CollectionProperty;
 import org.openstreetmap.josm.data.preferences.EnumProperty;
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
@@ -125,4 +124,7 @@
     public static final IntegerProperty PROPERTY_RECENT_TAGS_NUMBER = new IntegerProperty("properties.recently-added-tags",
             DEFAULT_LRU_TAGS_NUMBER);
+    /** The preference storage of recent tags */
+    public static final CollectionProperty COLLECTION_PROPERTY = new CollectionProperty("properties.recent-tags",
+            Collections.<String>emptyList());
 
     /**
@@ -156,11 +158,5 @@
         "properties.refresh-recently-added-tags", RefreshRecent.class, RefreshRecent.STATUS);
 
-    // LRU cache for recently added tags (http://java-planet.blogspot.com/2005/08/how-to-set-up-simple-lru-cache-using.html)
-    private final Map<Tag, Void> recentTags = new LinkedHashMap<Tag, Void>(MAX_LRU_TAGS_NUMBER+1, 1.1f, true) {
-        @Override
-        protected boolean removeEldestEntry(Map.Entry<Tag, Void> eldest) {
-            return size() > MAX_LRU_TAGS_NUMBER;
-        }
-    };
+    final RecentTagCollection recentTags = new RecentTagCollection(MAX_LRU_TAGS_NUMBER);
 
     // Copy of recently added tags, used to cache initial status
@@ -291,12 +287,5 @@
     public void loadTagsIfNeeded() {
         if (PROPERTY_REMEMBER_TAGS.get() && recentTags.isEmpty()) {
-            recentTags.clear();
-            Collection<String> c = Main.pref.getCollection("properties.recent-tags");
-            Iterator<String> it = c.iterator();
-            while (it.hasNext()) {
-                String key = it.next();
-                String value = it.next();
-                recentTags.put(new Tag(key, value), null);
-            }
+            recentTags.loadFromPreference(COLLECTION_PROPERTY);
         }
     }
@@ -307,10 +296,5 @@
     public void saveTagsIfNeeded() {
         if (PROPERTY_REMEMBER_TAGS.get() && !recentTags.isEmpty()) {
-            List<String> c = new ArrayList<>(recentTags.size()*2);
-            for (Tag t: recentTags.keySet()) {
-                c.add(t.getKey());
-                c.add(t.getValue());
-            }
-            Main.pref.putCollection("properties.recent-tags", c);
+            recentTags.saveToPreference(COLLECTION_PROPERTY);
         }
     }
@@ -320,5 +304,5 @@
      */
     private void cacheRecentTags() {
-        tags = new LinkedList<>(recentTags.keySet());
+        tags = recentTags.toList();
     }
 
@@ -857,6 +841,4 @@
             // This implies to iterate in descending order, as the oldest elements will only be removed after we reach the maximum
             // number and not the number of tags to show.
-            // However, as Set does not allow to iterate in descending order, we need to copy its elements into a List we can access
-            // in reverse order.
             for (int i = tags.size()-1; i >= 0 && count < tagsToShow; i--) {
                 final Tag t = tags.get(i);
@@ -995,5 +977,5 @@
             lastAddKey = key;
             lastAddValue = value;
-            recentTags.put(new Tag(key, value), null);
+            recentTags.add(new Tag(key, value));
             valueCount.put(key, new TreeMap<String, Integer>());
             AutoCompletionManager.rememberUserInput(key, value, false);
