### Question:
DateUtils { public static OffsetDateTime createCurrentDateTimestamp() { return OffsetDateTime.now(ZoneOffset.UTC); } private  DateUtils(); static OffsetDateTime createCurrentDateTimestamp(); static String createCurrentDateString(String format); static String formatDate(OffsetDateTime date, String format); static OffsetDateTime fromDateUTC(Date date); static OffsetDateTime parseDate(String dateTime, String format); static final String DOCKER_DATE_FORMAT; static final String AUDIT_DATE_FORMAT; static final String UTC_DATE_FORMAT_TO_MINUTE; }### Answer:
@Test public void createCurrentDateTimestampOffsetTest() { OffsetDateTime alertDateTime = DateUtils.createCurrentDateTimestamp(); assertEquals(ZoneOffset.UTC, alertDateTime.getOffset()); }
@Test public void createCurrentDateTimestampZonedDateTimeTest() { OffsetDateTime alertDateTime = DateUtils.createCurrentDateTimestamp(); ZonedDateTime localZonedDateTime = ZonedDateTime.now(); ZonedDateTime reZonedLocalTime = localZonedDateTime.withZoneSameInstant(alertDateTime.getOffset()); assertEquals(alertDateTime.getHour(), reZonedLocalTime.getHour()); assertEquals(alertDateTime.getMinute(), reZonedLocalTime.getMinute()); }
@Test public void checkCurrentTime() throws InterruptedException { OffsetDateTime firstTimeStamp = DateUtils.createCurrentDateTimestamp(); TimeUnit.SECONDS.sleep(1); OffsetDateTime currentDateTimestamp = DateUtils.createCurrentDateTimestamp(); assertTrue(currentDateTimestamp.isAfter(firstTimeStamp)); assertTrue(firstTimeStamp.isBefore(currentDateTimestamp)); }