@Test void generatedLocalDateTimeShouldNotBeNull() { assertThat(randomizer.getRandomValue()).isNotNull(); }
@Override public LocalDateTime getRandomValue() { long minSeconds = min.toEpochSecond(ZoneOffset.UTC); long maxSeconds = max.toEpochSecond(ZoneOffset.UTC); long seconds = (long) nextDouble(minSeconds, maxSeconds); int minNanoSeconds = min.getNano(); int maxNanoSeconds = max.getNano(); long nanoSeconds = (long) nextDouble(minNanoSeconds, maxNanoSeconds); Instant instant = Instant.ofEpochSecond(seconds, nanoSeconds); return LocalDateTime.ofInstant(instant, ZoneOffset.UTC); }
LocalDateTimeRangeRandomizer extends AbstractRangeRandomizer<LocalDateTime> { @Override public LocalDateTime getRandomValue() { long minSeconds = min.toEpochSecond(ZoneOffset.UTC); long maxSeconds = max.toEpochSecond(ZoneOffset.UTC); long seconds = (long) nextDouble(minSeconds, maxSeconds); int minNanoSeconds = min.getNano(); int maxNanoSeconds = max.getNano(); long nanoSeconds = (long) nextDouble(minNanoSeconds, maxNanoSeconds); Instant instant = Instant.ofEpochSecond(seconds, nanoSeconds); return LocalDateTime.ofInstant(instant, ZoneOffset.UTC); } }
LocalDateTimeRangeRandomizer extends AbstractRangeRandomizer<LocalDateTime> { @Override public LocalDateTime getRandomValue() { long minSeconds = min.toEpochSecond(ZoneOffset.UTC); long maxSeconds = max.toEpochSecond(ZoneOffset.UTC); long seconds = (long) nextDouble(minSeconds, maxSeconds); int minNanoSeconds = min.getNano(); int maxNanoSeconds = max.getNano(); long nanoSeconds = (long) nextDouble(minNanoSeconds, maxNanoSeconds); Instant instant = Instant.ofEpochSecond(seconds, nanoSeconds); return LocalDateTime.ofInstant(instant, ZoneOffset.UTC); } LocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max);  LocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max, final long seed); }
LocalDateTimeRangeRandomizer extends AbstractRangeRandomizer<LocalDateTime> { @Override public LocalDateTime getRandomValue() { long minSeconds = min.toEpochSecond(ZoneOffset.UTC); long maxSeconds = max.toEpochSecond(ZoneOffset.UTC); long seconds = (long) nextDouble(minSeconds, maxSeconds); int minNanoSeconds = min.getNano(); int maxNanoSeconds = max.getNano(); long nanoSeconds = (long) nextDouble(minNanoSeconds, maxNanoSeconds); Instant instant = Instant.ofEpochSecond(seconds, nanoSeconds); return LocalDateTime.ofInstant(instant, ZoneOffset.UTC); } LocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max);  LocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max, final long seed); static LocalDateTimeRangeRandomizer aNewLocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max); static LocalDateTimeRangeRandomizer aNewLocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max, final long seed); @Override LocalDateTime getRandomValue(); }
LocalDateTimeRangeRandomizer extends AbstractRangeRandomizer<LocalDateTime> { @Override public LocalDateTime getRandomValue() { long minSeconds = min.toEpochSecond(ZoneOffset.UTC); long maxSeconds = max.toEpochSecond(ZoneOffset.UTC); long seconds = (long) nextDouble(minSeconds, maxSeconds); int minNanoSeconds = min.getNano(); int maxNanoSeconds = max.getNano(); long nanoSeconds = (long) nextDouble(minNanoSeconds, maxNanoSeconds); Instant instant = Instant.ofEpochSecond(seconds, nanoSeconds); return LocalDateTime.ofInstant(instant, ZoneOffset.UTC); } LocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max);  LocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max, final long seed); static LocalDateTimeRangeRandomizer aNewLocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max); static LocalDateTimeRangeRandomizer aNewLocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max, final long seed); @Override LocalDateTime getRandomValue();  }