@Test public void getTime() throws Exception { assertNotNull(TimeContext.getTime()); final Instant now = Instant.now(); TimeContext.setTime(now); assertEquals("The time should be equal", now, TimeContext.getTime()); assertSame("The time must be the same since Instant is immutable", now, TimeContext.getTime()); assertSame("The time must be the same since Instant is immutable", TimeContext.getTime(), TimeContext.getTime()); TimeContext.clear(); }
public static Instant getTime() { final Instant instant = NOW.get(); if (instant == null) { return Instant.now(); } return instant; }
TimeContext { public static Instant getTime() { final Instant instant = NOW.get(); if (instant == null) { return Instant.now(); } return instant; } }
TimeContext { public static Instant getTime() { final Instant instant = NOW.get(); if (instant == null) { return Instant.now(); } return instant; } private  TimeContext(); }
TimeContext { public static Instant getTime() { final Instant instant = NOW.get(); if (instant == null) { return Instant.now(); } return instant; } private  TimeContext(); static ZoneId getZone(); static long getMillis(); static Instant getTime(); static LocalDate getLocalDate(); static LocalDateTime getLocalDateTime(); static ZonedDateTime getZonedDateTime(); static void setTime(final Instant time); static void setNow(); static void setZone(final ZoneId zoneId); static void clear(); static void destroy(); }
TimeContext { public static Instant getTime() { final Instant instant = NOW.get(); if (instant == null) { return Instant.now(); } return instant; } private  TimeContext(); static ZoneId getZone(); static long getMillis(); static Instant getTime(); static LocalDate getLocalDate(); static LocalDateTime getLocalDateTime(); static ZonedDateTime getZonedDateTime(); static void setTime(final Instant time); static void setNow(); static void setZone(final ZoneId zoneId); static void clear(); static void destroy();  }