Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 17844)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 17845)
@@ -33,4 +33,5 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.ListenerList;
+import org.openstreetmap.josm.tools.date.Interval;
 import org.xml.sax.SAXException;
 
@@ -330,5 +331,5 @@
     @Test
     void testGetMinMaxTimeForAllTracks() {
-        assertEquals(0, data.getMinMaxTimeForAllTracks().length);
+        assertFalse(data.getMinMaxTimeForAllTracks().isPresent());
 
         WayPoint p1 = new WayPoint(LatLon.NORTH_POLE);
@@ -343,8 +344,8 @@
         data.addTrack(new GpxTrack(Arrays.asList(Arrays.asList(p3, p4, p5)), Collections.emptyMap()));
 
-        Instant[] times = data.getMinMaxTimeForAllTracks();
-        assertEquals(times.length, 2);
-        assertEquals(Instant.ofEpochMilli(100020), times[0]);
-        assertEquals(Instant.ofEpochMilli(500020), times[1]);
+        Interval times = data.getMinMaxTimeForAllTracks().orElse(null);
+        assertEquals("1970-01-01T00:01:40.020Z/1970-01-01T00:08:20.020Z", times.toString());
+        assertEquals(Instant.ofEpochMilli(100020), times.getStart());
+        assertEquals(Instant.ofEpochMilli(500020), times.getEnd());
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 17844)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 17845)
@@ -10,5 +10,4 @@
 import java.awt.Color;
 import java.io.IOException;
-import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -217,13 +216,4 @@
 
     /**
-     * Unit test of {@link GpxLayer#formatTimespan}.
-     */
-    @Test
-    void testFormatTimespan() {
-        Instant[] timespan = {Instant.parse("2021-03-01T17:53:16Z"), Instant.parse("2021-04-03T08:19:19Z")};
-        assertEquals("2021-03-01 17:53:16 \u2013 2021-04-03 08:19:19 (32 days 14 h)", GpxLayer.formatTimespan(timespan));
-    }
-
-    /**
      * Unit test of {@link GpxLayer#mergeFrom}.
      * @throws Exception if any error occurs
Index: trunk/test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java	(revision 17845)
+++ trunk/test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java	(revision 17845)
@@ -0,0 +1,51 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools.date;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import java.time.Instant;
+import java.util.Locale;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class IntervalTest {
+
+    /**
+     * Setup test.
+     */
+    @RegisterExtension
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules().preferences();
+
+    /**
+     * Setup test.
+     */
+    @BeforeEach
+    void setUp() {
+        Locale.setDefault(Locale.ROOT);
+        DateUtils.PROP_ISO_DATES.put(true);
+    }
+
+    /**
+     * Unit test of {@link Interval#format}.
+     */
+    @Test
+    void testFormat() {
+        Interval interval = new Interval(Instant.parse("2021-03-01T17:53:16Z"), Instant.parse("2021-04-03T08:19:19Z"));
+        assertEquals("2021-03-01 17:53:16 \u2013 2021-04-03 08:19:19 (32 days 14 h)", interval.format());
+    }
+
+    /**
+     * Unit test of {@link Interval#toString}.
+     */
+    @Test
+    void testToString() {
+        Interval interval = new Interval(Instant.parse("2021-03-01T17:53:16Z"), Instant.parse("2021-04-03T08:19:19Z"));
+        assertEquals("2021-03-01T17:53:16Z/2021-04-03T08:19:19Z", interval.toString());
+    }
+
+}
