public static String dateTime(Date date) {
        if (date == null) {
            return null;
        }
        return formatter.format(date.toInstant().atZone(ZoneId.systemDefault()));
    }
@Test
    public void testDateTime() {
        Date testDate = Date.from(java.time.LocalDateTime.of(2022, 12, 25, 10, 20, 30).atZone(ZoneId.systemDefault()).toInstant());
        String expected = "2022-12-25 10:20:30";
        String actual = DateUtils.dateTime(testDate);
        assertEquals("Test when date is not null",expected, actual);
    }