diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java b/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
index 6901fed..e3b3ae5 100644
--- a/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
+++ b/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
@@ -86,13 +86,13 @@
  * Class that helps PropertiesDialog add and edit tag values.
  * @since 5633
  */
-class TagEditHelper {
+public class TagEditHelper {
     private final JTable tagTable;
     private final DefaultTableModel tagData;
     private final Map<String, Map<String, Integer>> valueCount;
 
     // Selection that we are editing by using both dialogs
-    private Collection<OsmPrimitive> sel;
+    protected Collection<OsmPrimitive> sel;
 
     private String changedKey;
     private String objKey;
@@ -118,7 +118,7 @@ protected boolean removeEldestEntry(Map.Entry<Tag, Void> eldest) {
         }
     };
 
-    TagEditHelper(JTable tagTable, DefaultTableModel propertyData, Map<String, Map<String, Integer>> valueCount) {
+    public TagEditHelper(JTable tagTable, DefaultTableModel propertyData, Map<String, Map<String, Integer>> valueCount) {
         this.tagTable = tagTable;
         this.tagData = propertyData;
         this.valueCount = valueCount;
@@ -142,7 +142,7 @@ public void addTag() {
         sel = Main.main.getInProgressSelection();
         if (sel == null || sel.isEmpty()) return;
 
-        final AddTagsDialog addDialog = new AddTagsDialog();
+        final AddTagsDialog addDialog = getAddTagsDialog();
 
         addDialog.showDialog();
 
@@ -153,6 +153,10 @@ public void addTag() {
             addDialog.undoAllTagsAdding();
     }
 
+    protected AddTagsDialog getAddTagsDialog() {
+        return new AddTagsDialog();
+    }
+
     /**
     * Edit the value in the tags table row.
     * @param row The row of the table from which the value is edited.
@@ -167,12 +171,24 @@ public void editTag(final int row, boolean focusOnKey) {
         String key = getDataKey(row);
         objKey = key;
 
-        final EditTagDialog editDialog = new EditTagDialog(key, getDataValues(row), focusOnKey);
+        final IEditTagDialog editDialog = getEditTagDialog(row, focusOnKey, key);
         editDialog.showDialog();
         if (editDialog.getValue() != 1) return;
         editDialog.performTagEdit();
     }
 
+    protected interface IEditTagDialog {
+        ExtendedDialog showDialog();
+
+        int getValue();
+
+        void performTagEdit();
+    }
+
+    protected IEditTagDialog getEditTagDialog(int row, boolean focusOnKey, String key) {
+        return new EditTagDialog(key, getDataValues(row), focusOnKey);
+    }
+
     /**
      * If during last editProperty call user changed the key name, this key will be returned
      * Elsewhere, returns null.
@@ -250,7 +266,7 @@ private static boolean warnOverwriteKey(String action, String togglePref) {
         return ed.getValue() == 1;
     }
 
-    public final class EditTagDialog extends AbstractTagsDialog {
+    protected class EditTagDialog extends AbstractTagsDialog implements IEditTagDialog {
         private final String key;
         private final transient Map<String, Integer> m;
 
@@ -289,7 +305,7 @@ public Component getListCellRendererComponent(JList<? extends AutoCompletionList
             }
         };
 
-        private EditTagDialog(String key, Map<String, Integer> map, final boolean initialFocusOnKey) {
+        protected EditTagDialog(String key, Map<String, Integer> map, final boolean initialFocusOnKey) {
             super(Main.parent, trn("Change value?", "Change values?", map.size()), new String[] {tr("OK"), tr("Cancel")});
             setButtonIcons(new String[] {"ok", "cancel"});
             setCancelButton(2);
@@ -365,7 +381,8 @@ public void windowOpened(WindowEvent e) {
          * If value == "", tag will be deleted
          * Confirmations may be needed.
          */
-        private void performTagEdit() {
+        @Override
+        public void performTagEdit() {
             String value = Tag.removeWhiteSpaces(values.getEditor().getItem().toString());
             value = Normalizer.normalize(value, java.text.Normalizer.Form.NFC);
             if (value.isEmpty()) {
@@ -429,7 +446,7 @@ private void performTagEdit() {
     public static final IntegerProperty PROPERTY_RECENT_TAGS_NUMBER = new IntegerProperty("properties.recently-added-tags",
             DEFAULT_LRU_TAGS_NUMBER);
 
-    abstract class AbstractTagsDialog extends ExtendedDialog {
+    protected abstract class AbstractTagsDialog extends ExtendedDialog {
         protected AutoCompletingComboBox keys;
         protected AutoCompletingComboBox values;
         protected Component componentUnderMouse;
@@ -545,13 +562,14 @@ public void actionPerformed(ActionEvent e) {
         };
     }
 
-    class AddTagsDialog extends AbstractTagsDialog {
+    protected class AddTagsDialog extends AbstractTagsDialog {
         private final List<JosmAction> recentTagsActions = new ArrayList<>();
+        protected final FocusAdapter focus;
 
         // Counter of added commands for possible undo
         private int commandCount;
 
-        AddTagsDialog() {
+        protected AddTagsDialog() {
             super(Main.parent, tr("Add value?"), new String[] {tr("OK"), tr("Cancel")});
             setButtonIcons(new String[] {"ok", "cancel"});
             setCancelButton(2);
@@ -603,15 +621,10 @@ public void actionPerformed(ActionEvent e) {
                 }
             }
 
-            FocusAdapter focus = addFocusAdapter(autocomplete, defaultACItemComparator);
+            focus = addFocusAdapter(autocomplete, defaultACItemComparator);
             // fire focus event in advance or otherwise the popup list will be too small at first
             focus.focusGained(null);
 
-            int recentTagsToShow = PROPERTY_RECENT_TAGS_NUMBER.get();
-            if (recentTagsToShow > MAX_LRU_TAGS_NUMBER) {
-                recentTagsToShow = MAX_LRU_TAGS_NUMBER;
-            }
-
             // Add tag on Shift-Enter
             mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                         KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK), "addAndContinue");
@@ -623,7 +636,7 @@ public void actionPerformed(ActionEvent e) {
                     }
                 });
 
-            suggestRecentlyAddedTags(mainPanel, recentTagsToShow, focus);
+            suggestRecentlyAddedTags(mainPanel, focus);
 
             mainPanel.add(Box.createVerticalGlue(), GBC.eop().fill());
             setContent(mainPanel, false);
@@ -673,7 +686,7 @@ public void setContentPane(Container contentPane) {
             super.setContentPane(contentPane);
         }
 
-        private void selectNumberOfTags() {
+        protected void selectNumberOfTags() {
             String s = JOptionPane.showInputDialog(this, tr("Please enter the number of recently added tags to display"));
             if (s == null) {
                 return;
@@ -690,7 +703,8 @@ private void selectNumberOfTags() {
             JOptionPane.showMessageDialog(this, tr("Please enter integer number between 0 and {0}", MAX_LRU_TAGS_NUMBER));
         }
 
-        private void suggestRecentlyAddedTags(JPanel mainPanel, int tagsToShow, final FocusAdapter focus) {
+        protected void suggestRecentlyAddedTags(JPanel mainPanel, final FocusAdapter focus) {
+            final int tagsToShow = Math.max(PROPERTY_RECENT_TAGS_NUMBER.get(), MAX_LRU_TAGS_NUMBER);
             if (!(tagsToShow > 0 && !recentTags.isEmpty()))
                 return;
 
@@ -816,7 +830,7 @@ public final void performTagAdding() {
             String key = Tag.removeWhiteSpaces(keys.getEditor().getItem().toString());
             String value = Tag.removeWhiteSpaces(values.getEditor().getItem().toString());
             if (key.isEmpty() || value.isEmpty()) return;
-            for (OsmPrimitive osm: sel) {
+            for (OsmPrimitive osm : sel) {
                 String val = osm.get(key);
                 if (val != null && !val.equals(value)) {
                     if (!warnOverwriteKey(tr("You changed the value of ''{0}'' from ''{1}'' to ''{2}''.", key, val, value),
@@ -832,6 +846,10 @@ public final void performTagAdding() {
             commandCount++;
             Main.main.undoRedo.add(new ChangePropertyCommand(sel, key, value));
             changedKey = key;
+            clearEntries();
+        }
+
+        protected void clearEntries() {
             keys.getEditor().setItem("");
             values.getEditor().setItem("");
         }
