<D extends ChronoLocalDate> ChronoLocalDateTimeImpl<D> ensureChronoLocalDateTime(Temporal temporal) {
        @SuppressWarnings("unchecked")
        ChronoLocalDateTimeImpl<D> other = (ChronoLocalDateTimeImpl<D>) temporal;
        if (this.equals(other.toLocalDate().getChronology()) == false) {
            throw new ClassCastException("Chrono mismatch, required: " + getId()
                    + ", supplied: " + other.toLocalDate().getChronology().getId());
        }
        return other;
    }
< D extends ChronoLocalDate > ChronoLocalDateTimeImpl < D > ensureChronoLocalDateTime ( Temporal temporal ) { @ SuppressWarnings ( "unchecked" ) ChronoLocalDateTimeImpl < D > other = ( ChronoLocalDateTimeImpl < D > ) temporal ; if ( this . equals ( other . toLocalDate ( ) . getChronology ( ) ) == false ) { throw new ClassCastException ( "Chrono mismatch, required: " + getId ( ) + ", supplied: " + other . toLocalDate ( ) . getChronology ( ) . getId ( ) ) ; } return other ; }
Casts the {@code Temporal} to {@code ChronoLocalDateTime} with the same chronology.

@param temporal   a date-time to cast, not null
@return the date-time checked and cast to {@code ChronoLocalDateTime}, not null
@throws ClassCastException if the date-time cannot be cast to ChronoLocalDateTimeImpl
or the chronology is not equal this Chrono