public static LocalDate randomLocalDate(LocalDate startInclusive, LocalDate endExclusive) {
    checkArgument(startInclusive != null, "Start must be non-null");
    checkArgument(endExclusive != null, "End must be non-null");
    Instant startInstant = startInclusive.atStartOfDay().toInstant(UTC_OFFSET);
    Instant endInstant = endExclusive.atStartOfDay().toInstant(UTC_OFFSET);
    Instant instant = randomInstant(startInstant, endInstant);
    return instant.atZone(UTC).toLocalDate();
  }
public static LocalDate randomLocalDate ( LocalDate startInclusive , LocalDate endExclusive ) { checkArgument ( startInclusive != null , "Start must be non-null" ) ; checkArgument ( endExclusive != null , "End must be non-null" ) ; Instant startInstant = startInclusive . atStartOfDay ( ) . toInstant ( UTC_OFFSET ) ; Instant endInstant = endExclusive . atStartOfDay ( ) . toInstant ( UTC_OFFSET ) ; Instant instant = randomInstant ( startInstant , endInstant ) ; return instant . atZone ( UTC ) . toLocalDate ( ) ; }
Returns a random {@link LocalDate} within the specified range.

@param startInclusive the earliest {@link LocalDate} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link LocalDate}
@throws IllegalArgumentException if startInclusive or endExclusive are null or if endExclusive
is earlier than startInclusive