code: static <R extends ChronoLocalDate> ChronoLocalDateTimeImpl<R> ensureValid(Chronology chrono, Temporal temporal) {
          @SuppressWarnings("unchecked")
          ChronoLocalDateTimeImpl<R> other = (ChronoLocalDateTimeImpl<R>) temporal;
          if (chrono.equals(other.getChronology()) == false) {
              throw new ClassCastException("Chronology mismatch, required: " + chrono.getId()
                      + ", actual: " + other.getChronology().getId());
          }
          return other;
      }
docs: Casts the {@code Temporal} to {@code ChronoLocalDateTime} ensuring it bas the specified chronology.
  
  @param chrono  the chronology to check for, not null
  @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 Chronology