Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12765)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12766)
@@ -8,4 +8,5 @@
 import java.awt.Dimension;
 import java.awt.GraphicsEnvironment;
+import java.awt.GridBagLayout;
 import java.awt.event.KeyEvent;
 import java.io.File;
@@ -48,5 +49,7 @@
 import javax.swing.InputMap;
 import javax.swing.JComponent;
+import javax.swing.JLabel;
 import javax.swing.JOptionPane;
+import javax.swing.JPanel;
 import javax.swing.KeyStroke;
 import javax.swing.LookAndFeel;
@@ -80,4 +83,5 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.UserInfo;
 import org.openstreetmap.josm.data.osm.search.SearchMode;
 import org.openstreetmap.josm.data.validation.OsmValidator;
@@ -107,4 +111,5 @@
 import org.openstreetmap.josm.gui.util.RedirectInputMap;
 import org.openstreetmap.josm.gui.util.WindowGeometry;
+import org.openstreetmap.josm.gui.widgets.UrlLabel;
 import org.openstreetmap.josm.io.CertificateAmendment;
 import org.openstreetmap.josm.io.DefaultProxySelector;
@@ -122,4 +127,5 @@
 import org.openstreetmap.josm.plugins.PluginInformation;
 import org.openstreetmap.josm.tools.FontsManager;
+import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.HttpClient;
 import org.openstreetmap.josm.tools.I18n;
@@ -968,4 +974,5 @@
 
     static void setupCallbacks() {
+        MessageNotifier.setNotifierCallback(MainApplication::notifyNewMessages);
         DeleteCommand.setDeletionCallback(DeleteAction.defaultDeletionCallback);
     }
@@ -1307,3 +1314,19 @@
         }
     }
+
+    static void notifyNewMessages(UserInfo userInfo) {
+        GuiHelper.runInEDT(() -> {
+            JPanel panel = new JPanel(new GridBagLayout());
+            panel.add(new JLabel(trn("You have {0} unread message.", "You have {0} unread messages.",
+                    userInfo.getUnreadMessages(), userInfo.getUnreadMessages())),
+                    GBC.eol());
+            panel.add(new UrlLabel(Main.getBaseUserUrl() + '/' + userInfo.getDisplayName() + "/inbox",
+                    tr("Click here to see your inbox.")), GBC.eol());
+            panel.setOpaque(false);
+            new Notification().setContent(panel)
+                .setIcon(JOptionPane.INFORMATION_MESSAGE)
+                .setDuration(Notification.TIME_LONG)
+                .show();
+        });
+    }
 }
Index: trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 12765)
+++ trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 12766)
@@ -3,7 +3,5 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.trn;
 
-import java.awt.GridBagLayout;
 import java.net.Authenticator.RequestorType;
 import java.util.concurrent.Executors;
@@ -12,8 +10,4 @@
 import java.util.concurrent.TimeUnit;
 
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.UserIdentityManager;
@@ -21,13 +15,9 @@
 import org.openstreetmap.josm.data.preferences.BooleanProperty;
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
-import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
-import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.gui.widgets.UrlLabel;
 import org.openstreetmap.josm.io.auth.CredentialsAgentException;
 import org.openstreetmap.josm.io.auth.CredentialsAgentResponse;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.io.auth.JosmPreferencesCredentialAgent;
-import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
@@ -41,4 +31,27 @@
     private MessageNotifier() {
         // Hide default constructor for utils classes
+    }
+
+    /**
+     * Called when new new messages are detected.
+     * @since xxx
+     */
+    @FunctionalInterface
+    public interface NotifierCallback {
+        /**
+         * Perform the actual notification of new messages.
+         * @param userInfo the new user information, that includes the number of unread messages
+         */
+        void notifyNewMessages(UserInfo userInfo);
+    }
+
+    private static NotifierCallback callback;
+
+    /**
+     * Sets the {@link NotifierCallback} responsible of notifying the user when new messages are received.
+     * @param notifierCallback the new {@code NotifierCallback}
+     */
+    public static void setNotifierCallback(NotifierCallback notifierCallback) {
+        callback = notifierCallback;
     }
 
@@ -71,16 +84,5 @@
                     final int unread = userInfo.getUnreadMessages();
                     if (unread > 0 && unread != lastUnreadCount) {
-                        GuiHelper.runInEDT(() -> {
-                            JPanel panel = new JPanel(new GridBagLayout());
-                            panel.add(new JLabel(trn("You have {0} unread message.", "You have {0} unread messages.", unread, unread)),
-                                    GBC.eol());
-                            panel.add(new UrlLabel(Main.getBaseUserUrl() + '/' + userInfo.getDisplayName() + "/inbox",
-                                    tr("Click here to see your inbox.")), GBC.eol());
-                            panel.setOpaque(false);
-                            new Notification().setContent(panel)
-                                .setIcon(JOptionPane.INFORMATION_MESSAGE)
-                                .setDuration(Notification.TIME_LONG)
-                                .show();
-                        });
+                        callback.notifyNewMessages(userInfo);
                         lastUnreadCount = unread;
                     }
Index: trunk/src/org/openstreetmap/josm/tools/Logging.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Logging.java	(revision 12765)
+++ trunk/src/org/openstreetmap/josm/tools/Logging.java	(revision 12766)
@@ -283,5 +283,4 @@
     }
 
-
     private static void logPrivate(Level level, String pattern, Object... args) {
         logPrivate(level, () -> MessageFormat.format(pattern, args));
