@Override
public long until(Temporal endExclusive, TemporalUnit unit) {
@SuppressWarnings("unchecked")
ChronoLocalDateTime<D> end = (ChronoLocalDateTime<D>) toLocalDate().getChronology().localDateTime(endExclusive);
if (unit instanceof ChronoUnit) {
ChronoUnit f = (ChronoUnit) unit;
if (f.isTimeBased()) {
long amount = end.getLong(EPOCH_DAY) - date.getLong(EPOCH_DAY);
switch (f) {
case NANOS: amount = Jdk8Methods.safeMultiply(amount, NANOS_PER_DAY); break;
case MICROS: amount = Jdk8Methods.safeMultiply(amount, MICROS_PER_DAY); break;
case MILLIS: amount = Jdk8Methods.safeMultiply(amount, MILLIS_PER_DAY); break;