Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 31797)
@@ -110,5 +110,5 @@
   public String toString() {
     return "Image[key=" + this.key + ";lat=" + this.latLon.lat() + ";lon="
-        + this.latLon.lon() + ";ca=" + this.ca + "]";
+        + this.latLon.lon() + ";ca=" + this.ca + ']';
   }
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31797)
@@ -74,5 +74,5 @@
 
   /** Maximum distance for the red/blue lines. */
-  public final static int SEQUENCE_MAX_JUMP_DISTANCE = Main.pref.getInteger(
+  public static final int SEQUENCE_MAX_JUMP_DISTANCE = Main.pref.getInteger(
       "mapillary.sequence-max-jump-distance", 100);
 
@@ -81,9 +81,9 @@
 
   /** Unique instance of the class. */
-  public static MapillaryLayer INSTANCE;
+  private static MapillaryLayer instance;
   /** The image pointed by the blue line. */
-  public static MapillaryImage BLUE;
+  private MapillaryImage blue;
   /** The image pointed by the red line. */
-  public static MapillaryImage RED;
+  private MapillaryImage red;
   /** {@link MapillaryData} object that stores the database. */
   private final MapillaryData data;
@@ -110,6 +110,4 @@
    */
   private void init() {
-    if (INSTANCE == null)
-      INSTANCE = this;
     if (Main.main != null && Main.map.mapView != null) {
       setMode(new SelectMode());
@@ -166,12 +164,26 @@
 
   /**
+   * Clears the unique instance of this class.
+   */
+  public static void clearInstance() {
+    instance = null;
+  }
+
+  /**
    * Returns the unique instance of this class.
    *
    * @return The unique instance of this class.
    */
-  public synchronized static MapillaryLayer getInstance() {
-    if (INSTANCE == null)
-      return new MapillaryLayer();
-    return MapillaryLayer.INSTANCE;
+  public static synchronized MapillaryLayer getInstance() {
+    if (instance == null)
+      instance = new MapillaryLayer();
+    return instance;
+  }
+
+  /**
+   * @return if the unique instance of this layer is currently instantiated
+   */
+  public static boolean hasInstance() {
+    return instance != null;
   }
 
@@ -184,4 +196,18 @@
   public MapillaryData getData() {
     return this.data;
+  }
+
+  /**
+   * @return The image that is linked to the current image with a blue line
+   */
+  public MapillaryImage getBlue() {
+    return blue;
+  }
+
+  /**
+   * @return The image that is linked to the current image with a blue line
+   */
+  public MapillaryImage getRed() {
+    return red;
   }
 
@@ -203,11 +229,4 @@
     clearInstance();
     super.destroy();
-  }
-
-  /**
-   * Clears the unique instance of this class.
-   */
-  public static void clearInstance() {
-    INSTANCE = null;
   }
 
@@ -284,6 +303,6 @@
 
     // Draw colored lines
-    MapillaryLayer.BLUE = null;
-    MapillaryLayer.RED = null;
+    blue = null;
+    red = null;
     MapillaryMainDialog.getInstance().blueButton.setEnabled(false);
     MapillaryMainDialog.getInstance().redButton.setEnabled(false);
@@ -294,5 +313,5 @@
       Point selected = mv.getPoint(this.data.getSelectedImage().getLatLon());
       if (closestImages[0] != null) {
-        MapillaryLayer.BLUE = closestImages[0];
+        blue = closestImages[0];
         g.setColor(Color.BLUE);
         g.drawLine(mv.getPoint(closestImages[0].getLatLon()).x,
@@ -301,5 +320,5 @@
       }
       if (closestImages[1] != null) {
-        MapillaryLayer.RED = closestImages[1];
+        red = closestImages[1];
         g.setColor(Color.RED);
         g.drawLine(mv.getPoint(closestImages[1].getLatLon()).x,
@@ -392,6 +411,5 @@
    *          The P¡{@link Point} when the image lies.
    */
-  private void draw(Graphics2D g, MapillaryAbstractImage image, ImageIcon icon,
-      Point p) {
+  private void draw(Graphics2D g, MapillaryAbstractImage image, ImageIcon icon, Point p) {
     Image imagetemp = icon.getImage();
     BufferedImage bi = (BufferedImage) imagetemp;
@@ -401,13 +419,10 @@
     // Rotate the image
     double rotationRequired = Math.toRadians(image.getCa());
-    double locationX = width / 2;
-    double locationY = height / 2;
-    AffineTransform tx = AffineTransform.getRotateInstance(rotationRequired,
-        locationX, locationY);
-    AffineTransformOp op = new AffineTransformOp(tx,
-        AffineTransformOp.TYPE_BILINEAR);
-
-    g.drawImage(op.filter(bi, null), p.x - (width / 2), p.y - (height / 2),
-        Main.map.mapView);
+    double locationX = width / 2d;
+    double locationY = height / 2d;
+    AffineTransform tx = AffineTransform.getRotateInstance(rotationRequired, locationX, locationY);
+    AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
+
+    g.drawImage(op.filter(bi, null), p.x - (width / 2), p.y - (height / 2), Main.map.mapView);
     if (this.data.getHighlightedImage() == image) {
       drawPointHighlight(g, p, 16);
@@ -433,9 +448,9 @@
   @Override
   public Action[] getMenuEntries() {
-    List<Action> actions = new ArrayList<>();
-    actions.add(LayerListDialog.getInstance().createShowHideLayerAction());
-    actions.add(LayerListDialog.getInstance().createDeleteLayerAction());
-    actions.add(new LayerListPopup.InfoAction(this));
-    return actions.toArray(new Action[actions.size()]);
+    return new Action[]{
+      LayerListDialog.getInstance().createShowHideLayerAction(),
+      LayerListDialog.getInstance().createDeleteLayerAction(),
+      new LayerListPopup.InfoAction(this)
+    };
   }
 
@@ -560,8 +575,10 @@
   @Override
   public void layerAdded(Layer newLayer) {
+    // Do nothing, we're only interested in layer change, not addition
   }
 
   @Override
   public void layerRemoved(Layer oldLayer) {
+    // Do nothing, we're only interested in layer change, not removal
   }
 
@@ -597,5 +614,5 @@
     @Override
     public void actionPerformed(ActionEvent e) {
-      if (INSTANCE != null)
+      if (instance != null)
         MapillaryRecord.getInstance().addCommand(
             new CommandDelete(getData().getMultiSelectedImages()));
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java	(revision 31797)
@@ -37,12 +37,9 @@
   @Override
   public void actionPerformed(ActionEvent arg0) {
-    if (MapillaryLayer.INSTANCE == null) {
-      MapillaryLayer.getInstance();
-    } else {
-      if (Main.map.mapView.getActiveLayer() != MapillaryLayer.getInstance())
-        Main.map.mapView.setActiveLayer(MapillaryLayer.getInstance());
-      else
-        Main.map.mapView.setActiveLayer(Main.map.mapView.getEditLayer());
-    }
+    MapillaryLayer.getInstance();
+    if (Main.map.mapView.getActiveLayer() != MapillaryLayer.getInstance())
+      Main.map.mapView.setActiveLayer(MapillaryLayer.getInstance());
+    else
+      Main.map.mapView.setActiveLayer(Main.map.mapView.getEditLayer());
   }
 }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java	(revision 31797)
@@ -124,9 +124,4 @@
 
   @Override
-  public synchronized void interrupt() {
-    super.interrupt();
-  }
-
-  @Override
   public void imagesAdded() {
     // Nothing
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/CacheUtils.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/CacheUtils.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/CacheUtils.java	(revision 31797)
@@ -18,5 +18,5 @@
 public class CacheUtils {
 
-  private static IgnoreDownload IGNORE_DOWNLOAD = new IgnoreDownload();
+  private static IgnoreDownload ignoreDownload = new IgnoreDownload();
 
   /** Picture quality */
@@ -54,16 +54,14 @@
     switch (pic) {
       case BOTH:
-        if (new MapillaryCache(img.getKey(), MapillaryCache.Type.THUMBNAIL)
-            .get() == null)
-          submit(img.getKey(), MapillaryCache.Type.THUMBNAIL, IGNORE_DOWNLOAD);
-        if (new MapillaryCache(img.getKey(), MapillaryCache.Type.FULL_IMAGE)
-            .get() == null)
-          submit(img.getKey(), MapillaryCache.Type.FULL_IMAGE, IGNORE_DOWNLOAD);
+        if (new MapillaryCache(img.getKey(), MapillaryCache.Type.THUMBNAIL).get() == null)
+          submit(img.getKey(), MapillaryCache.Type.THUMBNAIL, ignoreDownload);
+        if (new MapillaryCache(img.getKey(), MapillaryCache.Type.FULL_IMAGE).get() == null)
+          submit(img.getKey(), MapillaryCache.Type.FULL_IMAGE, ignoreDownload);
         break;
       case THUMBNAIL:
-        submit(img.getKey(), MapillaryCache.Type.THUMBNAIL, IGNORE_DOWNLOAD);
+        submit(img.getKey(), MapillaryCache.Type.THUMBNAIL, ignoreDownload);
         break;
       case FULL_IMAGE:
-        submit(img.getKey(), MapillaryCache.Type.FULL_IMAGE, IGNORE_DOWNLOAD);
+        submit(img.getKey(), MapillaryCache.Type.FULL_IMAGE, ignoreDownload);
         break;
     }
@@ -93,6 +91,6 @@
 
     @Override
-    public void loadingFinished(CacheEntry arg0, CacheEntryAttributes arg1,
-        LoadResult arg2) {
+    public void loadingFinished(CacheEntry arg0, CacheEntryAttributes arg1, LoadResult arg2) {
+      // Ignore download
     }
   }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java	(revision 31797)
@@ -17,9 +17,8 @@
  *
  */
-public class MapillaryCache extends
-    JCSCachedTileLoaderJob<String, BufferedImageCacheEntry> {
+public class MapillaryCache extends JCSCachedTileLoaderJob<String, BufferedImageCacheEntry> {
 
-  private volatile URL url;
-  private volatile String key;
+  private final URL url;
+  private final String key;
 
   /**
@@ -28,5 +27,5 @@
    * @author nokutu
    */
-  public static enum Type {
+  public enum Type {
     /** Full quality image */
     FULL_IMAGE,
@@ -46,21 +45,26 @@
   public MapillaryCache(String key, Type type) {
     super(MapillaryPlugin.CACHE, 50000, 50000, new HashMap<String, String>());
-    this.key = key;
-    try {
-      switch (type) {
-        case FULL_IMAGE:
-          this.url = new URL("https://d1cuyjsrcm0gby.cloudfront.net/" + key
-              + "/thumb-2048.jpg");
-          this.key += ".FULL_IMAGE";
-          break;
-        case THUMBNAIL:
-          this.url = new URL("https://d1cuyjsrcm0gby.cloudfront.net/" + key
-              + "/thumb-320.jpg");
-          this.key += ".THUMBNAIL";
-          break;
+    String k = null;
+    URL u = null;
+    if (key != null && type != null) {
+      try {
+        switch (type) {
+          case FULL_IMAGE:
+            k = key + ".FULL_IMAGE";
+            u = new URL("https://d1cuyjsrcm0gby.cloudfront.net/" + key + "/thumb-2048.jpg");
+            break;
+          case THUMBNAIL:
+          default:
+            k = key + ".THUMBNAIL";
+            u = new URL("https://d1cuyjsrcm0gby.cloudfront.net/" + key + "/thumb-320.jpg");
+            break;
+        }
+      } catch (MalformedURLException e) {
+        // TODO: Throw exception, so that a MapillaryCache with malformed URL can't be instantiated.
+        Main.error(e);
       }
-    } catch (MalformedURLException e) {
-      Main.error(e);
     }
+    this.key = k;
+    this.url = u;
   }
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java	(revision 31797)
@@ -47,5 +47,5 @@
   public final JCheckBox noTurn = new JCheckBox();
 
-  private static MapillaryFilterChooseSigns INSTANCE;
+  private static MapillaryFilterChooseSigns instance;
 
   private MapillaryFilterChooseSigns() {
@@ -172,7 +172,7 @@
    */
   public static MapillaryFilterChooseSigns getInstance() {
-    if (INSTANCE == null)
-      INSTANCE = new MapillaryFilterChooseSigns();
-    return INSTANCE;
+    if (instance == null)
+      instance = new MapillaryFilterChooseSigns();
+    return instance;
   }
 }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 31797)
@@ -47,5 +47,5 @@
   private static MapillaryFilterDialog INSTANCE;
 
-  private final static String[] TIME_LIST = { tr("All"), tr("Years"),
+  private static final String[] TIME_LIST = { tr("All"), tr("Years"),
       tr("Months"), tr("Days") };
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java	(revision 31797)
@@ -54,5 +54,5 @@
   private static final long serialVersionUID = -3019715241209349372L;
 
-  private static MapillaryHistoryDialog INSTANCE;
+  private static MapillaryHistoryDialog instance;
 
   private transient UndoRedoSelectionListener undoSelectionListener;
@@ -133,7 +133,7 @@
    */
   public static MapillaryHistoryDialog getInstance() {
-    if (INSTANCE == null)
-      INSTANCE = new MapillaryHistoryDialog();
-    return INSTANCE;
+    if (instance == null)
+      instance = new MapillaryHistoryDialog();
+    return instance;
   }
 
@@ -149,7 +149,6 @@
       this.undoButton.setEnabled(false);
     ArrayList<MapillaryCommand> redoCommands = new ArrayList<>();
-    if (commands.size() > 0 && position + 1 < commands.size())
-      redoCommands = new ArrayList<>(commands.subList(position + 1,
-          commands.size()));
+    if (!commands.isEmpty() && position + 1 < commands.size())
+      redoCommands = new ArrayList<>(commands.subList(position + 1, commands.size()));
     else
       this.redoButton.setEnabled(false);
@@ -161,6 +160,5 @@
     for (MapillaryCommand command : undoCommands) {
       if (command != null) {
-        DefaultMutableTreeNode node = new DefaultMutableTreeNode(
-            command.toString());
+        DefaultMutableTreeNode node = new DefaultMutableTreeNode(command.toString());
         this.map.put(node, command);
         undoRoot.add(node);
@@ -169,6 +167,5 @@
     for (MapillaryCommand command : redoCommands) {
       if (command != null) {
-        DefaultMutableTreeNode node = new DefaultMutableTreeNode(
-            command.toString());
+        DefaultMutableTreeNode node = new DefaultMutableTreeNode(command.toString());
         this.map.put(node, command);
         redoRoot.add(node);
@@ -176,6 +173,5 @@
     }
 
-    this.separator.setVisible(!undoCommands.isEmpty()
-        || !redoCommands.isEmpty());
+    this.separator.setVisible(!undoCommands.isEmpty() || !redoCommands.isEmpty());
     this.spacer.setVisible(undoCommands.isEmpty() && !redoCommands.isEmpty());
 
@@ -246,5 +242,5 @@
    */
   public static void destroyInstance() {
-    MapillaryHistoryDialog.INSTANCE = null;
+    MapillaryHistoryDialog.instance = null;
   }
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java	(revision 31797)
@@ -429,5 +429,5 @@
   }
 
-  private final static Point getCenterImgCoord(Rectangle visibleRect) {
+  private static final Point getCenterImgCoord(Rectangle visibleRect) {
     return new Point(visibleRect.x + visibleRect.width / 2, visibleRect.y
         + visibleRect.height / 2);
@@ -500,5 +500,5 @@
   }
 
-  private final static void checkVisibleRectPos(Image image, Rectangle visibleRect) {
+  private static final void checkVisibleRectPos(Image image, Rectangle visibleRect) {
     if (visibleRect.x < 0) {
       visibleRect.x = 0;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31797)
@@ -54,7 +54,7 @@
   private static final long serialVersionUID = 6856496736429480600L;
 
-  private final static String BASE_TITLE = marktr("Mapillary picture");
-
-  private static MapillaryMainDialog INSTANCE;
+  private static final String BASE_TITLE = marktr("Mapillary picture");
+
+  private static MapillaryMainDialog instance;
 
   private volatile MapillaryAbstractImage image;
@@ -62,13 +62,13 @@
   private final SideButton nextButton = new SideButton(new nextPictureAction());
   private final SideButton previousButton = new SideButton(
-      new previousPictureAction());
+      new PreviousPictureAction());
   /** Button used to jump to the image following the red line */
-  public final SideButton redButton = new SideButton(new redAction());
+  public final SideButton redButton = new SideButton(new RedAction());
   /** Button used to jump to the image following the blue line */
-  public final SideButton blueButton = new SideButton(new blueAction());
-
-  private final SideButton playButton = new SideButton(new playAction());
-  private final SideButton pauseButton = new SideButton(new pauseAction());
-  private final SideButton stopButton = new SideButton(new stopAction());
+  public final SideButton blueButton = new SideButton(new BlueAction());
+
+  private final SideButton playButton = new SideButton(new PlayAction());
+  private final SideButton pauseButton = new SideButton(new PauseAction());
+  private final SideButton stopButton = new SideButton(new StopAction());
 
   /**
@@ -78,5 +78,5 @@
    *
    */
-  public static enum MODE {
+  public enum MODE {
     /** Standard mode to view pictures. */
     NORMAL,
@@ -123,11 +123,11 @@
         KeyStroke.getKeyStroke("PAGE_UP"), "previous");
     this.previousButton.getActionMap().put("previous",
-        new previousPictureAction());
+        new PreviousPictureAction());
     this.blueButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
         KeyStroke.getKeyStroke("control PAGE_UP"), "blue");
-    this.blueButton.getActionMap().put("blue", new blueAction());
+    this.blueButton.getActionMap().put("blue", new BlueAction());
     this.redButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
         KeyStroke.getKeyStroke("control PAGE_DOWN"), "red");
-    this.redButton.getActionMap().put("red", new redAction());
+    this.redButton.getActionMap().put("red", new RedAction());
   }
 
@@ -138,7 +138,7 @@
    */
   public static MapillaryMainDialog getInstance() {
-    if (INSTANCE == null)
-      INSTANCE = new MapillaryMainDialog();
-    return INSTANCE;
+    if (instance == null)
+      instance = new MapillaryMainDialog();
+    return instance;
   }
 
@@ -151,16 +151,15 @@
   public void setMode(MODE mode) {
     switch (mode) {
-      case NORMAL:
-        createLayout(
-            this.mapillaryImageDisplay,
-            Arrays.asList(new SideButton[] { this.blueButton,
-                this.previousButton, this.nextButton, this.redButton }),
-            Main.pref.getBoolean("mapillary.reverse-buttons"));
-        break;
       case WALK:
         createLayout(
             this.mapillaryImageDisplay,
-            Arrays.asList(new SideButton[] { this.playButton, this.pauseButton,
-                this.stopButton }),
+            Arrays.asList(new SideButton[] { playButton, pauseButton, stopButton }),
+            Main.pref.getBoolean("mapillary.reverse-buttons"));
+        break;
+      case NORMAL:
+      default:
+        createLayout(
+            this.mapillaryImageDisplay,
+            Arrays.asList(new SideButton[] { blueButton, previousButton, nextButton, redButton }),
             Main.pref.getBoolean("mapillary.reverse-buttons"));
         break;
@@ -176,5 +175,5 @@
    */
   public static void destroyInstance() {
-    INSTANCE = null;
+    instance = null;
   }
 
@@ -204,5 +203,5 @@
       });
     } else {
-      if (MapillaryLayer.INSTANCE == null) {
+      if (!MapillaryLayer.hasInstance()) {
         return;
       }
@@ -309,21 +308,19 @@
         }
       });
-    } else {
-      if (this.image != null) {
-        if (this.image instanceof MapillaryImage) {
-          MapillaryImage mapillaryImage = (MapillaryImage) this.image;
-          String title = tr(BASE_TITLE);
-          if (mapillaryImage.getUser() != null)
-            title += " -- " + mapillaryImage.getUser();
-          if (mapillaryImage.getCapturedAt() != 0)
-            title += " -- " + mapillaryImage.getDate();
-          setTitle(title);
-        } else if (this.image instanceof MapillaryImportedImage) {
-          MapillaryImportedImage mapillaryImportedImage = (MapillaryImportedImage) this.image;
-          String title = tr(BASE_TITLE);
-          title += " -- " + mapillaryImportedImage.getFile().getName();
-          title += " -- " + mapillaryImportedImage.getDate();
-          setTitle(title);
-        }
+    } else if (this.image != null) {
+      if (this.image instanceof MapillaryImage) {
+        MapillaryImage mapillaryImage = (MapillaryImage) this.image;
+        String title = tr(BASE_TITLE);
+        if (mapillaryImage.getUser() != null)
+          title += " -- " + mapillaryImage.getUser();
+        if (mapillaryImage.getCapturedAt() != 0)
+          title += " -- " + mapillaryImage.getDate();
+        setTitle(title);
+      } else if (this.image instanceof MapillaryImportedImage) {
+        MapillaryImportedImage mapillaryImportedImage = (MapillaryImportedImage) this.image;
+        String title = tr(BASE_TITLE);
+        title += " -- " + mapillaryImportedImage.getFile().getName();
+        title += " -- " + mapillaryImportedImage.getDate();
+        setTitle(title);
       }
     }
@@ -366,9 +363,9 @@
    *
    */
-  private class previousPictureAction extends AbstractAction {
+  private class PreviousPictureAction extends AbstractAction {
 
     private static final long serialVersionUID = -6420511632957956012L;
 
-    public previousPictureAction() {
+    public PreviousPictureAction() {
       putValue(NAME, tr("Previous picture"));
       putValue(SHORT_DESCRIPTION,
@@ -388,9 +385,9 @@
    *
    */
-  private class redAction extends AbstractAction {
+  private class RedAction extends AbstractAction {
 
     private static final long serialVersionUID = -6480229431481386376L;
 
-    public redAction() {
+    public RedAction() {
       putValue(NAME, tr("Jump to red"));
       putValue(SHORT_DESCRIPTION,
@@ -402,5 +399,5 @@
       if (MapillaryMainDialog.getInstance().getImage() != null) {
         MapillaryLayer.getInstance().getData()
-            .setSelectedImage(MapillaryLayer.RED, true);
+            .setSelectedImage(MapillaryLayer.getInstance().getRed(), true);
       }
     }
@@ -413,9 +410,9 @@
    *
    */
-  private class blueAction extends AbstractAction {
+  private class BlueAction extends AbstractAction {
 
     private static final long serialVersionUID = 6250690644594703314L;
 
-    public blueAction() {
+    public BlueAction() {
       putValue(NAME, tr("Jump to blue"));
       putValue(SHORT_DESCRIPTION,
@@ -427,10 +424,10 @@
       if (MapillaryMainDialog.getInstance().getImage() != null) {
         MapillaryLayer.getInstance().getData()
-            .setSelectedImage(MapillaryLayer.BLUE, true);
-      }
-    }
-  }
-
-  private class stopAction extends AbstractAction implements WalkListener {
+            .setSelectedImage(MapillaryLayer.getInstance().getBlue(), true);
+      }
+    }
+  }
+
+  private class StopAction extends AbstractAction implements WalkListener {
 
     private static final long serialVersionUID = -6561451575815789198L;
@@ -438,5 +435,5 @@
     private WalkThread thread;
 
-    public stopAction() {
+    public StopAction() {
       putValue(NAME, tr("Stop"));
       putValue(SHORT_DESCRIPTION, tr("Stops the walk."));
@@ -457,10 +454,10 @@
   }
 
-  private class playAction extends AbstractAction implements WalkListener {
+  private class PlayAction extends AbstractAction implements WalkListener {
 
     private static final long serialVersionUID = -17943404752082788L;
     private WalkThread thread;
 
-    public playAction() {
+    public PlayAction() {
       putValue(NAME, tr("Play"));
       putValue(SHORT_DESCRIPTION, tr("Continues with the paused walk."));
@@ -482,5 +479,5 @@
   }
 
-  private class pauseAction extends AbstractAction implements WalkListener {
+  private class PauseAction extends AbstractAction implements WalkListener {
 
     private static final long serialVersionUID = 4400240686337741192L;
@@ -488,5 +485,5 @@
     private WalkThread thread;
 
-    public pauseAction() {
+    public PauseAction() {
       putValue(NAME, tr("Pause"));
       putValue(SHORT_DESCRIPTION, tr("Pauses the walk."));
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java	(revision 31797)
@@ -3,4 +3,5 @@
 
 import java.util.ArrayList;
+import java.util.List;
 
 import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
@@ -16,5 +17,5 @@
 public class MapillaryRecord {
   /** The unique instance of the class. */
-  private static MapillaryRecord INSTANCE;
+  private static MapillaryRecord instance;
 
   private ArrayList<MapillaryRecordListener> listeners;
@@ -40,7 +41,7 @@
    */
   public static synchronized MapillaryRecord getInstance() {
-    if (MapillaryRecord.INSTANCE == null)
-      MapillaryRecord.INSTANCE = new MapillaryRecord();
-    return MapillaryRecord.INSTANCE;
+    if (MapillaryRecord.instance == null)
+      MapillaryRecord.instance = new MapillaryRecord();
+    return MapillaryRecord.instance;
   }
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31797)
@@ -39,7 +39,7 @@
 
   /** Base URL of the Mapillary API. */
-  public final static String BASE_URL = "https://a.mapillary.com/v2/";
+  public static final String BASE_URL = "https://a.mapillary.com/v2/";
   /** Client ID for the app */
-  public final static String CLIENT_ID = "T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz";
+  public static final String CLIENT_ID = "T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz";
   /** Executor that will run the petitions. */
   private static ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(3, 5,
@@ -179,12 +179,12 @@
   public static MapillaryDownloader.MODES getMode() {
     if (Main.pref.get("mapillary.download-mode").equals(MODES.Automatic.toString())
-        && (MapillaryLayer.INSTANCE == null || !MapillaryLayer.INSTANCE.TEMP_SEMIAUTOMATIC))
+        && (!MapillaryLayer.hasInstance() || !MapillaryLayer.getInstance().TEMP_SEMIAUTOMATIC))
       return MODES.Automatic;
     else if (Main.pref.get("mapillary.download-mode").equals(MODES.Semiautomatic.toString())
-        || (MapillaryLayer.INSTANCE != null && MapillaryLayer.getInstance().TEMP_SEMIAUTOMATIC))
+        || (MapillaryLayer.hasInstance() && MapillaryLayer.getInstance().TEMP_SEMIAUTOMATIC))
       return MODES.Semiautomatic;
     else if (Main.pref.get("mapillary.download-mode").equals(MODES.Manual.toString()))
       return MODES.Manual;
-    else if (Main.pref.get("mapillary.download-mode").equals(""))
+    else if ("".equals(Main.pref.get("mapillary.download-mode")))
       return MODES.Automatic;
     else
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportWriterThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportWriterThread.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportWriterThread.java	(revision 31797)
@@ -73,7 +73,6 @@
   public void run() {
     this.monitor.setCustomText("Downloaded 0/" + this.amount);
-    // File tempFile = null;
     BufferedImage img;
-    MapillaryAbstractImage mimg = null;
+    MapillaryAbstractImage mimg;
     String finalPath = "";
     for (int i = 0; i < this.amount; i++) {
@@ -91,5 +90,4 @@
           finalPath = this.path + "/"
               + ((MapillaryImportedImage) mimg).getFile().getName();
-        ;
 
         // Transforms the image into a byte array.
@@ -100,6 +98,6 @@
         // Write EXIF tags
         TiffOutputSet outputSet = null;
-        TiffOutputDirectory exifDirectory = null;
-        TiffOutputDirectory gpsDirectory = null;
+        TiffOutputDirectory exifDirectory;
+        TiffOutputDirectory gpsDirectory;
         // If the image is imported, loads the rest of the EXIF data.
         if (mimg instanceof MapillaryImportedImage) {
@@ -135,10 +133,7 @@
           exifDirectory.add(ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL,
               ((MapillaryImage) mimg).getDate("yyyy/MM/dd hh/mm/ss"));
-        outputSet.setGPSInDegrees(mimg.getLatLon().lon(), mimg.getLatLon()
-            .lat());
-        OutputStream os = new BufferedOutputStream(new FileOutputStream(
-            finalPath + ".jpg"));
-        new ExifRewriter()
-            .updateExifMetadataLossless(imageBytes, os, outputSet);
+        outputSet.setGPSInDegrees(mimg.getLatLon().lon(), mimg.getLatLon().lat());
+        OutputStream os = new BufferedOutputStream(new FileOutputStream(finalPath + ".jpg"));
+        new ExifRewriter().updateExifMetadataLossless(imageBytes, os, outputSet);
 
         os.close();
@@ -155,6 +150,5 @@
 
       // Increases the progress bar.
-      this.monitor.worked(PleaseWaitProgressMonitor.PROGRESS_BAR_MAX
-          / this.amount);
+      this.monitor.worked(PleaseWaitProgressMonitor.PROGRESS_BAR_MAX / this.amount);
       this.monitor.setCustomText("Downloaded " + (i + 1) + "/" + this.amount);
     }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java	(revision 31797)
@@ -27,5 +27,5 @@
     ZoomChangeListener {
 
-  private final static int DOWNLOAD_COOLDOWN = 2000;
+  private static final int DOWNLOAD_COOLDOWN = 2000;
 
   protected MapillaryData data = MapillaryLayer.getInstance().getData();
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java	(revision 31797)
@@ -190,5 +190,5 @@
    * @param mapillaryAbstractImage2
    */
-  public synchronized static void join(
+  public static synchronized void join(
       MapillaryAbstractImage mapillaryAbstractImage,
       MapillaryAbstractImage mapillaryAbstractImage2) {
@@ -433,5 +433,5 @@
    * @param mapillaryAbstractImage2
    */
-  public synchronized static void unjoin(
+  public static synchronized void unjoin(
       MapillaryAbstractImage mapillaryAbstractImage,
       MapillaryAbstractImage mapillaryAbstractImage2) {
Index: /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryLayerTest.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryLayerTest.java	(revision 31797)
+++ /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryLayerTest.java	(revision 31797)
@@ -0,0 +1,28 @@
+package org.openstreetmap.josm.plugins.mapillary;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import org.junit.Test;
+import org.openstreetmap.josm.data.imagery.ImageryInfo;
+import org.openstreetmap.josm.gui.layer.ImageryLayer;
+import org.openstreetmap.josm.gui.layer.Layer;
+
+public class MapillaryLayerTest extends AbstractTest {
+  private Layer dummyLayer = ImageryLayer.create(new ImageryInfo());
+
+  @Test
+  public void testGetIcon() {
+    assertEquals(MapillaryPlugin.ICON16, MapillaryLayer.getInstance().getIcon());
+  }
+
+  @Test
+  public void testIsMergable() {
+    assertFalse(MapillaryLayer.getInstance().isMergable(dummyLayer));
+  }
+
+  @Test(expected=UnsupportedOperationException.class)
+  public void testMergeFrom() {
+    MapillaryLayer.getInstance().mergeFrom(dummyLayer);
+  }
+}
Index: /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java	(revision 31797)
+++ /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java	(revision 31797)
@@ -0,0 +1,30 @@
+package org.openstreetmap.josm.plugins.mapillary.cache;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+
+import org.junit.Test;
+import org.openstreetmap.josm.plugins.mapillary.AbstractTest;
+import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache.Type;
+
+public class MapillaryCacheTest extends AbstractTest {
+
+  @Test
+  public void test() {
+    MapillaryCache cache = new MapillaryCache("00000", Type.FULL_IMAGE);
+    assertNotEquals(null, cache.getUrl());
+    assertNotEquals(null, cache.getCacheKey());
+
+    assertFalse(cache.isObjectLoadable());
+
+    cache = new MapillaryCache("00000", Type.THUMBNAIL);
+    assertNotEquals(null, cache.getCacheKey());
+    assertNotEquals(null, cache.getUrl());
+
+    cache = new MapillaryCache(null, null);
+    assertEquals(null, cache.getCacheKey());
+    assertEquals(null, cache.getUrl());
+  }
+
+}
Index: plications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThreadTest.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThreadTest.java	(revision 31796)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/**
- *
- */
-package org.openstreetmap.josm.plugins.mapillary.downloads;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.Locale;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.junit.Test;
-import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.plugins.mapillary.AbstractTest;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
-import org.openstreetmap.josm.plugins.mapillary.io.download.MapillaryDownloader;
-import org.openstreetmap.josm.plugins.mapillary.io.download.MapillarySequenceDownloadThread;
-
-/**
- *
- */
-public class MapillarySequenceDownloadThreadTest extends AbstractTest {
-
-  /**
-   * Test method for
-   * {@link org.openstreetmap.josm.plugins.mapillary.io.download.MapillarySequenceDownloadThread#run()}
-   * .
-   *
-   * This downloads a small area of mapillary-sequences where we know that
-   * images already exist. When the download-thread finishes, we check if the
-   * Mapillary-layer now contains one or more images.
-   *
-   * @throws InterruptedException
-   */
-  @Test
-  public void testRun() throws InterruptedException {
-    System.out.println("[JUnit] MapillarySequenceDownloadThreadTest.testRun()");
-    // Area around image UjEbeXZYIoyAKOsE-remlg (59.32125452° N 18.06166856° E)
-    LatLon minLatLon = new LatLon(59.3212545, 18.0616685);
-    LatLon maxLatLon = new LatLon(59.3212546, 18.0616686);
-
-    ExecutorService ex = Executors.newSingleThreadExecutor();
-    String queryString = String
-        .format(
-            Locale.UK,
-            "?max_lat=%.8f&max_lon=%.8f&min_lat=%.8f&min_lon=%.8f&limit=10&client_id=%s",
-            maxLatLon.lat(), maxLatLon.lon(), minLatLon.lat(), minLatLon.lon(),
-            MapillaryDownloader.CLIENT_ID);
-    MapillaryLayer.getInstance().getData().bounds.add(new Bounds(minLatLon,
-        maxLatLon));
-
-    int page = 1;
-    while (!ex.isShutdown()
-        && MapillaryLayer.getInstance().getData().getImages().size() <= 0
-        && page < 50) {
-      System.out.println("Sending sequence-request " + page
-          + " to Mapillary-servers…");
-      Thread downloadThread = new MapillarySequenceDownloadThread(ex,
-          queryString + "&page=" + page);
-      downloadThread.start();
-      downloadThread.join();
-      page++;
-      Thread.sleep(500);
-    }
-    assertTrue(MapillaryLayer.getInstance().getData().getImages().size() >= 1);
-    System.out
-        .println("One or more images were added to the MapillaryLayer within the given bounds.");
-  }
-
-}
Index: /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordTest.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordTest.java	(revision 31796)
+++ /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordTest.java	(revision 31797)
@@ -2,4 +2,6 @@
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -266,10 +268,8 @@
 
     this.record.addCommand(cmd1);
-    assertEquals(false, MapillaryLayer.getInstance().getData().getImages()
-        .contains(this.img1));
+    assertFalse(MapillaryLayer.getInstance().getData().getImages().contains(this.img1));
     assertEquals(null, this.img2.previous());
     this.record.undo();
-    assertEquals(true, MapillaryLayer.getInstance().getData().getImages()
-        .contains(this.img1));
+    assertTrue(MapillaryLayer.getInstance().getData().getImages().contains(this.img1));
     this.record.redo();
     this.record.addCommand(cmd2);
Index: /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThreadTest.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThreadTest.java	(revision 31797)
+++ /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThreadTest.java	(revision 31797)
@@ -0,0 +1,71 @@
+/**
+ *
+ */
+package org.openstreetmap.josm.plugins.mapillary.io.download;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.Locale;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.junit.Test;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.plugins.mapillary.AbstractTest;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+import org.openstreetmap.josm.plugins.mapillary.io.download.MapillaryDownloader;
+import org.openstreetmap.josm.plugins.mapillary.io.download.MapillarySequenceDownloadThread;
+
+/**
+ *
+ */
+public class MapillarySequenceDownloadThreadTest extends AbstractTest {
+
+  /**
+   * Test method for
+   * {@link org.openstreetmap.josm.plugins.mapillary.io.download.MapillarySequenceDownloadThread#run()}
+   * .
+   *
+   * This downloads a small area of mapillary-sequences where we know that
+   * images already exist. When the download-thread finishes, we check if the
+   * Mapillary-layer now contains one or more images.
+   *
+   * @throws InterruptedException
+   */
+  @Test
+  public void testRun() throws InterruptedException {
+    System.out.println("[JUnit] MapillarySequenceDownloadThreadTest.testRun()");
+    // Area around image UjEbeXZYIoyAKOsE-remlg (59.32125452° N 18.06166856° E)
+    LatLon minLatLon = new LatLon(59.3212545, 18.0616685);
+    LatLon maxLatLon = new LatLon(59.3212546, 18.0616686);
+
+    ExecutorService ex = Executors.newSingleThreadExecutor();
+    String queryString = String
+        .format(
+            Locale.UK,
+            "?max_lat=%.8f&max_lon=%.8f&min_lat=%.8f&min_lon=%.8f&limit=10&client_id=%s",
+            maxLatLon.lat(), maxLatLon.lon(), minLatLon.lat(), minLatLon.lon(),
+            MapillaryDownloader.CLIENT_ID);
+    MapillaryLayer.getInstance().getData().bounds.add(new Bounds(minLatLon,
+        maxLatLon));
+
+    int page = 1;
+    while (!ex.isShutdown()
+        && MapillaryLayer.getInstance().getData().getImages().size() <= 0
+        && page < 50) {
+      System.out.println("Sending sequence-request " + page
+          + " to Mapillary-servers…");
+      Thread downloadThread = new MapillarySequenceDownloadThread(ex,
+          queryString + "&page=" + page);
+      downloadThread.start();
+      downloadThread.join();
+      page++;
+      Thread.sleep(500);
+    }
+    assertTrue(MapillaryLayer.getInstance().getData().getImages().size() >= 1);
+    System.out
+        .println("One or more images were added to the MapillaryLayer within the given bounds.");
+  }
+
+}
