Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 10906)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 10906)
@@ -0,0 +1,34 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.gpx;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
+
+/**
+ * Unit tests for class {@link GpxData}.
+ */
+public class GpxDataTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of methods {@link GpxData#equals} and {@link GpxData#hashCode}.
+     */
+    @Test
+    public void testEqualsContract() {
+        EqualsVerifier.forClass(GpxData.class).usingGetClass()
+            .withIgnoredFields("attr", "creator", "fromServer", "storageFile")
+            .withPrefabValues(WayPoint.class, new WayPoint(LatLon.NORTH_POLE), new WayPoint(LatLon.SOUTH_POLE))
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxRouteTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxRouteTest.java	(revision 10906)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxRouteTest.java	(revision 10906)
@@ -0,0 +1,35 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.gpx;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+/**
+ * Unit tests for class {@link GpxRoute}.
+ */
+public class GpxRouteTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of methods {@link GpxRoute#equals} and {@link GpxRoute#hashCode}.
+     */
+    @Test
+    public void testEqualsContract() {
+        EqualsVerifier.forClass(GpxRoute.class).usingGetClass()
+            .suppress(Warning.NONFINAL_FIELDS)
+            .withPrefabValues(WayPoint.class, new WayPoint(LatLon.NORTH_POLE), new WayPoint(LatLon.SOUTH_POLE))
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackSegmentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackSegmentTest.java	(revision 10906)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackSegmentTest.java	(revision 10906)
@@ -0,0 +1,34 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.gpx;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
+
+/**
+ * Unit tests for class {@link ImmutableGpxTrackSegment}.
+ */
+public class ImmutableGpxTrackSegmentTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of methods {@link ImmutableGpxTrackSegment#equals} and {@link ImmutableGpxTrackSegment#hashCode}.
+     */
+    @Test
+    public void testEqualsContract() {
+        EqualsVerifier.forClass(ImmutableGpxTrackSegment.class).usingGetClass()
+            .withIgnoredFields("bounds", "length")
+            .withPrefabValues(WayPoint.class, new WayPoint(LatLon.NORTH_POLE), new WayPoint(LatLon.SOUTH_POLE))
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackTest.java	(revision 10906)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackTest.java	(revision 10906)
@@ -0,0 +1,34 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.gpx;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+/**
+ * Unit tests for class {@link ImmutableGpxTrack}.
+ */
+public class ImmutableGpxTrackTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of methods {@link ImmutableGpxTrack#equals} and {@link ImmutableGpxTrack#hashCode}.
+     */
+    @Test
+    public void testEqualsContract() {
+        EqualsVerifier.forClass(ImmutableGpxTrack.class).usingGetClass()
+            .suppress(Warning.NONFINAL_FIELDS)
+            .withIgnoredFields("bounds", "length")
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/WayPointTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/WayPointTest.java	(revision 10906)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/WayPointTest.java	(revision 10906)
@@ -0,0 +1,37 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.gpx;
+
+import java.awt.color.ColorSpace;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+/**
+ * Unit tests for class {@link WayPoint}.
+ */
+public class WayPointTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of methods {@link WayPoint#equals} and {@link WayPoint#hashCode}.
+     */
+    @Test
+    public void testEqualsContract() {
+        EqualsVerifier.forClass(WayPoint.class).usingGetClass()
+            .suppress(Warning.NONFINAL_FIELDS)
+            .withIgnoredFields("customColoring", "dir", "drawLine", "east", "north")
+            .withPrefabValues(ColorSpace.class, ColorSpace.getInstance(ColorSpace.CS_sRGB), ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB))
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.java	(revision 10906)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.java	(revision 10906)
@@ -0,0 +1,33 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.gpx;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+/**
+ * Unit tests for class {@link WithAttributes}.
+ */
+public class WithAttributesTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of methods {@link WithAttributes#equals} and {@link WithAttributes#hashCode}.
+     */
+    @Test
+    public void testEqualsContract() {
+        EqualsVerifier.forClass(WithAttributes.class).usingGetClass()
+            .suppress(Warning.NONFINAL_FIELDS)
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/io/NmeaReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/NmeaReaderTest.java	(revision 10904)
+++ trunk/test/unit/org/openstreetmap/josm/io/NmeaReaderTest.java	(revision 10906)
@@ -5,4 +5,5 @@
 
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -12,12 +13,15 @@
 import org.junit.Rule;
 import org.junit.Test;
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxConstants;
+import org.openstreetmap.josm.data.gpx.GpxData;
+import org.openstreetmap.josm.data.gpx.GpxTrack;
+import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
 import org.openstreetmap.josm.data.gpx.WayPoint;
-import org.openstreetmap.josm.io.NmeaReader.NMEA_TYPE;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.xml.sax.SAXException;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import nl.jqno.equalsverifier.EqualsVerifier;
 
 /**
@@ -31,12 +35,4 @@
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
-
-    /**
-     * Unit test of methods {@link NMEA_TYPE#equals} and {@link NMEA_TYPE#hashCode}.
-     */
-    @Test
-    public void testEqualsContract() {
-        EqualsVerifier.forClass(NMEA_TYPE.class).verify();
-    }
 
     /**
@@ -69,3 +65,53 @@
         assertEquals(null, wayPoints.get(0).get(GpxConstants.PT_PDOP));
     }
+
+    private static void compareWithReference(int ticket, String filename, int numCoor) throws IOException, SAXException {
+        GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(ticket, filename+".gpx"));
+        NmeaReader in = new NmeaReader(new FileInputStream(TestUtils.getRegressionDataFile(ticket, filename+".nmea")));
+        assertEquals(numCoor, in.getNumberOfCoordinates());
+        assertEquals(0, in.getParserMalformed());
+        assertEquals(in.data.dataSources, gpx.dataSources);
+        assertEquals(1, gpx.tracks.size());
+        assertEquals(1, in.data.tracks.size());
+        GpxTrack gpxTrack = gpx.tracks.iterator().next();
+        GpxTrack nmeaTrack = in.data.tracks.iterator().next();
+        assertEquals(gpxTrack.getBounds(), nmeaTrack.getBounds());
+        assertEquals(1, gpxTrack.getSegments().size());
+        assertEquals(1, nmeaTrack.getSegments().size());
+        GpxTrackSegment gpxSeg = gpxTrack.getSegments().iterator().next();
+        GpxTrackSegment nmeaSeg = nmeaTrack.getSegments().iterator().next();
+        assertEquals(gpxSeg.getBounds(), nmeaSeg.getBounds());
+        assertEquals(numCoor, gpxSeg.getWayPoints().size());
+        assertEquals(numCoor, nmeaSeg.getWayPoints().size());
+        WayPoint gpxWpt = gpxSeg.getWayPoints().iterator().next();
+        WayPoint nmeaWpt = nmeaSeg.getWayPoints().iterator().next();
+        assertEquals(gpxWpt.getCoor().getRoundedToOsmPrecision(), nmeaWpt.getCoor().getRoundedToOsmPrecision());
+    }
+
+    /**
+     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/1433">Bug #1433</a>.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testTicket1433() throws Exception {
+        compareWithReference(1433, "2008-08-14-16-04-58", 1241);
+    }
+
+    /**
+     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/1853">Bug #1853</a>.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testTicket1853() throws Exception {
+        compareWithReference(1853, "PosData-20081216-115434", 1285);
+    }
+
+    /**
+     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/2147">Bug #2147</a>.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testTicket2147() throws Exception {
+        compareWithReference(2147, "WG20080203171807.log", 487);
+    }
 }
