test_class.declarator: controller = new DatePickerController() {
          @Override
          public void onYearSelected(int year) {}
  
          @Override
          public void onDayOfMonthSelected(int year, int month, int day) {}
  
          @Override
          public void registerOnDateChangedListener(DatePickerDialog.OnDateChangedListener listener) {}
  
          @Override
          public void unregisterOnDateChangedListener(DatePickerDialog.OnDateChangedListener listener) {}
  
          @Override
          public MonthAdapter.CalendarDay getSelectedDay() {
              return new MonthAdapter.CalendarDay(Calendar.getInstance(), TimeZone.getDefault());
          }
  
          @Override
          public boolean isThemeDark() {
              return false;
          }
  
          @Override
          public int getAccentColor() {
              return 0;
          }
  
          @Override
          public boolean isHighlighted(int year, int month, int day) {
              return false;
          }
  
          @Override
          public int getFirstDayOfWeek() {
              return 0;
          }
  
          @Override
          public int getMinYear() {
              return 0;
          }
  
          @Override
          public int getMaxYear() {
              return 0;
          }
  
          @Override
          public Calendar getStartDate() {
              return Calendar.getInstance();
          }
  
          @Override
          public Calendar getEndDate() {
              return Calendar.getInstance();
          }
  
          @Override
          public boolean isOutOfRange(int year, int month, int day) {
              return false;
          }
  
          @Override
          public void tryVibrate() {}
  
          @Override
          public TimeZone getTimeZone() {
              return TimeZone.getDefault();
          }
  
          @Override
          public Locale getLocale() {
              return Locale.getDefault();
          }
  
          @Override
          public DatePickerDialog.Version getVersion() {
              return DatePickerDialog.Version.VERSION_2;
          }
  
          @Override
          public DatePickerDialog.ScrollOrientation getScrollOrientation() {
              return DatePickerDialog.ScrollOrientation.HORIZONTAL;
          }
      }
test_class.modifier: final private
test_class.original_string: final private DatePickerController controller = new DatePickerController() {
          @Override
          public void onYearSelected(int year) {}
  
          @Override
          public void onDayOfMonthSelected(int year, int month, int day) {}
  
          @Override
          public void registerOnDateChangedListener(DatePickerDialog.OnDateChangedListener listener) {}
  
          @Override
          public void unregisterOnDateChangedListener(DatePickerDialog.OnDateChangedListener listener) {}
  
          @Override
          public MonthAdapter.CalendarDay getSelectedDay() {
              return new MonthAdapter.CalendarDay(Calendar.getInstance(), TimeZone.getDefault());
          }
  
          @Override
          public boolean isThemeDark() {
              return false;
          }
  
          @Override
          public int getAccentColor() {
              return 0;
          }
  
          @Override
          public boolean isHighlighted(int year, int month, int day) {
              return false;
          }
  
          @Override
          public int getFirstDayOfWeek() {
              return 0;
          }
  
          @Override
          public int getMinYear() {
              return 0;
          }
  
          @Override
          public int getMaxYear() {
              return 0;
          }
  
          @Override
          public Calendar getStartDate() {
              return Calendar.getInstance();
          }
  
          @Override
          public Calendar getEndDate() {
              return Calendar.getInstance();
          }
  
          @Override
          public boolean isOutOfRange(int year, int month, int day) {
              return false;
          }
  
          @Override
          public void tryVibrate() {}
  
          @Override
          public TimeZone getTimeZone() {
              return TimeZone.getDefault();
          }
  
          @Override
          public Locale getLocale() {
              return Locale.getDefault();
          }
  
          @Override
          public DatePickerDialog.Version getVersion() {
              return DatePickerDialog.Version.VERSION_2;
          }
  
          @Override
          public DatePickerDialog.ScrollOrientation getScrollOrientation() {
              return DatePickerDialog.ScrollOrientation.HORIZONTAL;
          }
      };
test_class.type: DatePickerController
test_class.var_name: controller
test_class.file: library/src/test/java/com/wdullaer/materialdatetimepicker/date/DefaultDateRangeLimiterTest.java
test_class.identifier: DefaultDateRangeLimiterTest
test_case.body: @Test
      public void setToNearestShouldReturnTheInputWhenValid() {
          DefaultDateRangeLimiter limiter = new DefaultDateRangeLimiter();
          Calendar day = Calendar.getInstance();
          Calendar expected = (Calendar) day.clone();
  
          Assert.assertEquals(limiter.setToNearestDate(day).getTimeInMillis(), expected.getTimeInMillis());
      }
test_case.class_method_signature: DefaultDateRangeLimiterTest.setToNearestShouldReturnTheInputWhenValid()
test_case.full_signature: @Test public void setToNearestShouldReturnTheInputWhenValid()
test_case.identifier: setToNearestShouldReturnTheInputWhenValid
test_case.invocations: getInstance clone assertEquals getTimeInMillis setToNearestDate getTimeInMillis
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void setToNearestShouldReturnTheInputWhenValid()
focal_class.declarator: DEFAULT_START_YEAR = 1900
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_START_YEAR = 1900;
focal_class.type: int
focal_class.var_name: DEFAULT_START_YEAR
focal_class.declarator: DEFAULT_END_YEAR = 2100
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_END_YEAR = 2100;
focal_class.type: int
focal_class.var_name: DEFAULT_END_YEAR
focal_class.declarator: mController
focal_class.modifier: private transient
focal_class.original_string: private transient DatePickerController mController;
focal_class.type: DatePickerController
focal_class.var_name: mController
focal_class.declarator: mMinYear = DEFAULT_START_YEAR
focal_class.modifier: private
focal_class.original_string: private int mMinYear = DEFAULT_START_YEAR;
focal_class.type: int
focal_class.var_name: mMinYear
focal_class.declarator: mMaxYear = DEFAULT_END_YEAR
focal_class.modifier: private
focal_class.original_string: private int mMaxYear = DEFAULT_END_YEAR;
focal_class.type: int
focal_class.var_name: mMaxYear
focal_class.declarator: mMinDate
focal_class.modifier: private
focal_class.original_string: private Calendar mMinDate;
focal_class.type: Calendar
focal_class.var_name: mMinDate
focal_class.declarator: mMaxDate
focal_class.modifier: private
focal_class.original_string: private Calendar mMaxDate;
focal_class.type: Calendar
focal_class.var_name: mMaxDate
focal_class.declarator: selectableDays = new TreeSet<>()
focal_class.modifier: private
focal_class.original_string: private TreeSet<Calendar> selectableDays = new TreeSet<>();
focal_class.type: TreeSet<Calendar>
focal_class.var_name: selectableDays
focal_class.declarator: disabledDays = new HashSet<>()
focal_class.modifier: private
focal_class.original_string: private HashSet<Calendar> disabledDays = new HashSet<>();
focal_class.type: HashSet<Calendar>
focal_class.var_name: disabledDays
focal_class.declarator: CREATOR
              = new Parcelable.Creator<DefaultDateRangeLimiter>() {
          public DefaultDateRangeLimiter createFromParcel(Parcel in) {
              return new DefaultDateRangeLimiter(in);
          }
  
          public DefaultDateRangeLimiter[] newArray(int size) {
              return new DefaultDateRangeLimiter[size];
          }
      }
focal_class.modifier: @SuppressWarnings("WeakerAccess")
      public static final
focal_class.original_string: @SuppressWarnings("WeakerAccess")
      public static final Parcelable.Creator<DefaultDateRangeLimiter> CREATOR
              = new Parcelable.Creator<DefaultDateRangeLimiter>() {
          public DefaultDateRangeLimiter createFromParcel(Parcel in) {
              return new DefaultDateRangeLimiter(in);
          }
  
          public DefaultDateRangeLimiter[] newArray(int size) {
              return new DefaultDateRangeLimiter[size];
          }
      };
focal_class.type: Parcelable.Creator<DefaultDateRangeLimiter>
focal_class.var_name: CREATOR
focal_class.file: library/src/main/java/com/wdullaer/materialdatetimepicker/date/DefaultDateRangeLimiter.java
focal_class.identifier: DefaultDateRangeLimiter
focal_class.interfaces: implements DateRangeLimiter
focal_class.class_method_signature: DefaultDateRangeLimiter.DefaultDateRangeLimiter()
focal_class.full_signature:   DefaultDateRangeLimiter()
focal_class.identifier: DefaultDateRangeLimiter
focal_class.parameters: ()
focal_class.signature:  DefaultDateRangeLimiter()
focal_class.class_method_signature: DefaultDateRangeLimiter.DefaultDateRangeLimiter(Parcel in)
focal_class.full_signature: @SuppressWarnings({"unchecked", "WeakerAccess"}) public  DefaultDateRangeLimiter(Parcel in)
focal_class.identifier: DefaultDateRangeLimiter
focal_class.modifiers: @SuppressWarnings({"unchecked", "WeakerAccess"}) public
focal_class.parameters: (Parcel in)
focal_class.signature:  DefaultDateRangeLimiter(Parcel in)
focal_class.class_method_signature: DefaultDateRangeLimiter.writeToParcel(Parcel out, int flags)
focal_class.full_signature: @Override public void writeToParcel(Parcel out, int flags)
focal_class.identifier: writeToParcel
focal_class.modifiers: @Override public
focal_class.parameters: (Parcel out, int flags)
focal_class.return: void
focal_class.signature: void writeToParcel(Parcel out, int flags)
focal_class.class_method_signature: DefaultDateRangeLimiter.describeContents()
focal_class.full_signature: @Override public int describeContents()
focal_class.identifier: describeContents
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int describeContents()
focal_class.class_method_signature: DefaultDateRangeLimiter.setSelectableDays(@NonNull Calendar[] days)
focal_class.full_signature:  void setSelectableDays(@NonNull Calendar[] days)
focal_class.identifier: setSelectableDays
focal_class.parameters: (@NonNull Calendar[] days)
focal_class.return: void
focal_class.signature: void setSelectableDays(@NonNull Calendar[] days)
focal_class.class_method_signature: DefaultDateRangeLimiter.setDisabledDays(@NonNull Calendar[] days)
focal_class.full_signature:  void setDisabledDays(@NonNull Calendar[] days)
focal_class.identifier: setDisabledDays
focal_class.parameters: (@NonNull Calendar[] days)
focal_class.return: void
focal_class.signature: void setDisabledDays(@NonNull Calendar[] days)
focal_class.class_method_signature: DefaultDateRangeLimiter.setMinDate(@NonNull Calendar calendar)
focal_class.full_signature:  void setMinDate(@NonNull Calendar calendar)
focal_class.identifier: setMinDate
focal_class.parameters: (@NonNull Calendar calendar)
focal_class.return: void
focal_class.signature: void setMinDate(@NonNull Calendar calendar)
focal_class.class_method_signature: DefaultDateRangeLimiter.setMaxDate(@NonNull Calendar calendar)
focal_class.full_signature:  void setMaxDate(@NonNull Calendar calendar)
focal_class.identifier: setMaxDate
focal_class.parameters: (@NonNull Calendar calendar)
focal_class.return: void
focal_class.signature: void setMaxDate(@NonNull Calendar calendar)
focal_class.class_method_signature: DefaultDateRangeLimiter.setController(@NonNull DatePickerController controller)
focal_class.full_signature:  void setController(@NonNull DatePickerController controller)
focal_class.identifier: setController
focal_class.parameters: (@NonNull DatePickerController controller)
focal_class.return: void
focal_class.signature: void setController(@NonNull DatePickerController controller)
focal_class.class_method_signature: DefaultDateRangeLimiter.setYearRange(int startYear, int endYear)
focal_class.full_signature:  void setYearRange(int startYear, int endYear)
focal_class.identifier: setYearRange
focal_class.parameters: (int startYear, int endYear)
focal_class.return: void
focal_class.signature: void setYearRange(int startYear, int endYear)
focal_class.class_method_signature: DefaultDateRangeLimiter.getMinDate()
focal_class.full_signature: @Nullable Calendar getMinDate()
focal_class.identifier: getMinDate
focal_class.modifiers: @Nullable
focal_class.parameters: ()
focal_class.return: Calendar
focal_class.signature: Calendar getMinDate()
focal_class.class_method_signature: DefaultDateRangeLimiter.getMaxDate()
focal_class.full_signature: @Nullable Calendar getMaxDate()
focal_class.identifier: getMaxDate
focal_class.modifiers: @Nullable
focal_class.parameters: ()
focal_class.return: Calendar
focal_class.signature: Calendar getMaxDate()
focal_class.class_method_signature: DefaultDateRangeLimiter.getSelectableDays()
focal_class.full_signature: @Nullable Calendar[] getSelectableDays()
focal_class.identifier: getSelectableDays
focal_class.modifiers: @Nullable
focal_class.parameters: ()
focal_class.return: Calendar[]
focal_class.signature: Calendar[] getSelectableDays()
focal_class.class_method_signature: DefaultDateRangeLimiter.getDisabledDays()
focal_class.full_signature: @Nullable Calendar[] getDisabledDays()
focal_class.identifier: getDisabledDays
focal_class.modifiers: @Nullable
focal_class.parameters: ()
focal_class.return: Calendar[]
focal_class.signature: Calendar[] getDisabledDays()
focal_class.class_method_signature: DefaultDateRangeLimiter.getMinYear()
focal_class.full_signature: @Override public int getMinYear()
focal_class.identifier: getMinYear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMinYear()
focal_class.class_method_signature: DefaultDateRangeLimiter.getMaxYear()
focal_class.full_signature: @Override public int getMaxYear()
focal_class.identifier: getMaxYear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMaxYear()
focal_class.class_method_signature: DefaultDateRangeLimiter.getStartDate()
focal_class.full_signature: @Override public @NonNull Calendar getStartDate()
focal_class.identifier: getStartDate
focal_class.modifiers: @Override public @NonNull
focal_class.parameters: ()
focal_class.return: Calendar
focal_class.signature: Calendar getStartDate()
focal_class.class_method_signature: DefaultDateRangeLimiter.getEndDate()
focal_class.full_signature: @Override public @NonNull Calendar getEndDate()
focal_class.identifier: getEndDate
focal_class.modifiers: @Override public @NonNull
focal_class.parameters: ()
focal_class.return: Calendar
focal_class.signature: Calendar getEndDate()
focal_class.class_method_signature: DefaultDateRangeLimiter.isOutOfRange(int year, int month, int day)
focal_class.full_signature: @Override public boolean isOutOfRange(int year, int month, int day)
focal_class.identifier: isOutOfRange
focal_class.modifiers: @Override public
focal_class.parameters: (int year, int month, int day)
focal_class.return: boolean
focal_class.signature: boolean isOutOfRange(int year, int month, int day)
focal_class.class_method_signature: DefaultDateRangeLimiter.isOutOfRange(@NonNull Calendar calendar)
focal_class.full_signature: private boolean isOutOfRange(@NonNull Calendar calendar)
focal_class.identifier: isOutOfRange
focal_class.modifiers: private
focal_class.parameters: (@NonNull Calendar calendar)
focal_class.return: boolean
focal_class.signature: boolean isOutOfRange(@NonNull Calendar calendar)
focal_class.class_method_signature: DefaultDateRangeLimiter.isDisabled(@NonNull Calendar c)
focal_class.full_signature: private boolean isDisabled(@NonNull Calendar c)
focal_class.identifier: isDisabled
focal_class.modifiers: private
focal_class.parameters: (@NonNull Calendar c)
focal_class.return: boolean
focal_class.signature: boolean isDisabled(@NonNull Calendar c)
focal_class.class_method_signature: DefaultDateRangeLimiter.isSelectable(@NonNull Calendar c)
focal_class.full_signature: private boolean isSelectable(@NonNull Calendar c)
focal_class.identifier: isSelectable
focal_class.modifiers: private
focal_class.parameters: (@NonNull Calendar c)
focal_class.return: boolean
focal_class.signature: boolean isSelectable(@NonNull Calendar c)
focal_class.class_method_signature: DefaultDateRangeLimiter.isBeforeMin(@NonNull Calendar calendar)
focal_class.full_signature: private boolean isBeforeMin(@NonNull Calendar calendar)
focal_class.identifier: isBeforeMin
focal_class.modifiers: private
focal_class.parameters: (@NonNull Calendar calendar)
focal_class.return: boolean
focal_class.signature: boolean isBeforeMin(@NonNull Calendar calendar)
focal_class.class_method_signature: DefaultDateRangeLimiter.isAfterMax(@NonNull Calendar calendar)
focal_class.full_signature: private boolean isAfterMax(@NonNull Calendar calendar)
focal_class.identifier: isAfterMax
focal_class.modifiers: private
focal_class.parameters: (@NonNull Calendar calendar)
focal_class.return: boolean
focal_class.signature: boolean isAfterMax(@NonNull Calendar calendar)
focal_class.class_method_signature: DefaultDateRangeLimiter.setToNearestDate(@NonNull Calendar calendar)
focal_class.full_signature: @Override public @NonNull Calendar setToNearestDate(@NonNull Calendar calendar)
focal_class.identifier: setToNearestDate
focal_class.modifiers: @Override public @NonNull
focal_class.parameters: (@NonNull Calendar calendar)
focal_class.return: Calendar
focal_class.signature: Calendar setToNearestDate(@NonNull Calendar calendar)
focal_method.body: @Override
      public @NonNull Calendar setToNearestDate(@NonNull Calendar calendar) {
          if (!selectableDays.isEmpty()) {
              Calendar newCalendar = null;
              Calendar higher = selectableDays.ceiling(calendar);
              Calendar lower = selectableDays.lower(calendar);
  
              if (higher == null && lower != null) newCalendar = lower;
              else if (lower == null && higher != null) newCalendar = higher;
  
              if (newCalendar != null || higher == null) {
                  newCalendar = newCalendar == null ? calendar : newCalendar;
                  TimeZone timeZone = mController == null ? TimeZone.getDefault() : mController.getTimeZone();
                  newCalendar.setTimeZone(timeZone);
                  return (Calendar) newCalendar.clone();
              }
  
              long highDistance = Math.abs(higher.getTimeInMillis() - calendar.getTimeInMillis());
              long lowDistance = Math.abs(calendar.getTimeInMillis() - lower.getTimeInMillis());
  
              if (lowDistance < highDistance) return (Calendar) lower.clone();
              else return (Calendar) higher.clone();
          }
  
          if (!disabledDays.isEmpty()) {
              Calendar forwardDate = isBeforeMin(calendar) ? getStartDate() : (Calendar) calendar.clone();
              Calendar backwardDate = isAfterMax(calendar) ? getEndDate() : (Calendar) calendar.clone();
              while (isDisabled(forwardDate) && isDisabled(backwardDate)) {
                  forwardDate.add(Calendar.DAY_OF_MONTH, 1);
                  backwardDate.add(Calendar.DAY_OF_MONTH, -1);
              }
              if (!isDisabled(backwardDate)) {
                  return backwardDate;
              }
              if (!isDisabled(forwardDate)) {
                  return forwardDate;
              }
          }
  
          TimeZone timezone = mController == null ? TimeZone.getDefault() : mController.getTimeZone();
          if (isBeforeMin(calendar)) {
              if (mMinDate != null) return (Calendar) mMinDate.clone();
              Calendar output = Calendar.getInstance(timezone);
              output.set(Calendar.YEAR, mMinYear);
              output.set(Calendar.MONTH, Calendar.JANUARY);
              output.set(Calendar.DAY_OF_MONTH, 1);
              return Utils.trimToMidnight(output);
          }
  
          if (isAfterMax(calendar)) {
              if (mMaxDate != null) return (Calendar) mMaxDate.clone();
              Calendar output = Calendar.getInstance(timezone);
              output.set(Calendar.YEAR, mMaxYear);
              output.set(Calendar.MONTH, Calendar.DECEMBER);
              output.set(Calendar.DAY_OF_MONTH, 31);
              return Utils.trimToMidnight(output);
          }
  
          return calendar;
      }
focal_method.class_method_signature: DefaultDateRangeLimiter.setToNearestDate(@NonNull Calendar calendar)
focal_method.full_signature: @Override public @NonNull Calendar setToNearestDate(@NonNull Calendar calendar)
focal_method.identifier: setToNearestDate
focal_method.invocations: isEmpty ceiling lower getDefault getTimeZone setTimeZone clone abs getTimeInMillis getTimeInMillis abs getTimeInMillis getTimeInMillis clone clone isEmpty isBeforeMin getStartDate clone isAfterMax getEndDate clone isDisabled isDisabled add add isDisabled isDisabled getDefault getTimeZone isBeforeMin clone getInstance set set set trimToMidnight isAfterMax clone getInstance set set set trimToMidnight
focal_method.modifiers: @Override public @NonNull
focal_method.parameters: (@NonNull Calendar calendar)
focal_method.return: Calendar
focal_method.signature: Calendar setToNearestDate(@NonNull Calendar calendar)