Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 17716)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 17717)
@@ -8,7 +8,7 @@
 import static org.openstreetmap.josm.data.osm.Changeset.MAX_CHANGESET_TAG_LENGTH;
 
-import java.util.Calendar;
+import java.time.Duration;
+import java.time.Instant;
 import java.util.Collection;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -138,10 +138,4 @@
     }
 
-    private static Date yesterday() {
-        final Calendar cal = Calendar.getInstance();
-        cal.add(Calendar.DATE, -1);
-        return cal.getTime();
-    }
-
     /**
      * Unit test of method {@link Changeset#hasEqualSemanticAttributes}.
@@ -149,5 +143,6 @@
     @Test
     void testHasEqualSemanticAttributes() {
-        Date today = new Date();
+        Instant today = Instant.now();
+        Instant yesterday = today.minus(Duration.ofDays(1));
         Changeset cs1 = new Changeset();
         Changeset cs2 = new Changeset();
@@ -158,5 +153,5 @@
         cs2.setClosedAt(today);
         assertFalse(cs1.hasEqualSemanticAttributes(cs2));
-        cs1.setClosedAt(yesterday());
+        cs1.setClosedAt(yesterday);
         cs2.setClosedAt(today);
         assertFalse(cs1.hasEqualSemanticAttributes(cs2));
@@ -168,5 +163,5 @@
         cs2.setCreatedAt(today);
         assertFalse(cs1.hasEqualSemanticAttributes(cs2));
-        cs1.setCreatedAt(yesterday());
+        cs1.setCreatedAt(yesterday);
         cs2.setCreatedAt(today);
         assertFalse(cs1.hasEqualSemanticAttributes(cs2));
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java	(revision 17716)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java	(revision 17717)
@@ -12,4 +12,6 @@
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+import java.time.Instant;
 
 /**
@@ -31,4 +33,5 @@
         JList<Changeset> list = new JList<>();
         Changeset cs = new Changeset();
+        cs.setCreatedAt(Instant.EPOCH);
         ChangesetCellRenderer c = new ChangesetCellRenderer();
         assertEquals(c, c.getListCellRendererComponent(list, cs, 0, false, false));
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 17716)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 17717)
@@ -11,4 +11,5 @@
 import java.io.StringWriter;
 import java.nio.charset.StandardCharsets;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -16,5 +17,7 @@
 import java.util.List;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Changeset;
@@ -24,4 +27,5 @@
 import org.openstreetmap.josm.data.osm.UploadPolicy;
 import org.openstreetmap.josm.data.osm.User;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
 
 /**
@@ -29,4 +33,11 @@
  */
 class OsmWriterTest {
+
+    /**
+     * Setup rule
+     */
+    @RegisterExtension
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
@@ -107,8 +118,9 @@
         cs.setMin(new LatLon(12., 34.));
         cs.setMax(new LatLon(56., 78.));
+        cs.setCreatedAt(Instant.EPOCH);
         try (StringWriter stringWriter = new StringWriter();
              OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(stringWriter), true, OsmWriter.DEFAULT_API_VERSION)) {
             osmWriter.visit(cs);
-            assertEquals("  <changeset id='38038262' user='&lt;anonymous&gt;' uid='-1' open='false' " +
+            assertEquals("  <changeset id='38038262' user='&lt;anonymous&gt;' uid='-1' created_at='1970-01-01T00:00:00Z' open='false' " +
                             "min_lon='34.0' min_lat='12.0' max_lon='78.0' max_lat='56.0'>\n  </changeset>\n",
                     stringWriter.toString().replace("\r", ""));
