code: public static <T extends Calendar> T truncate(final T calendar, final int field) {
          N.checkArgNotNull(calendar, "calendar");
  
          final Calendar truncated = (Calendar) calendar.clone();
          modify(truncated, field, ModifyType.TRUNCATE);
  
          if (truncated.getClass().equals(calendar.getClass())) {
              return (T) truncated;
          }
  
          return createCalendar(calendar, truncated.getTimeInMillis());
      }
docs: Copied from Apache Commons Lang under Apache License v2.
  <br />
  
  <p>Truncates a date, leaving the field specified as the most
  significant field.</p>
  
  <p>For example, if you had the date-time of 28 Mar 2002
  13:45:01.231, if you passed with HOUR, it would return 28 Mar
  2002 13:00:00.000.  If this was passed with MONTH, it would
  return 1 Mar 2002 0:00:00.000.</p>
  
  @param calendar  the date to work with, not null
  @param field  the field from {@code Calendar} or <code>SEMI_MONTH</code>
  @return the different truncated date, not null
  @throws IllegalArgumentException if the date is <code>null</code>
  @throws ArithmeticException if the year is over 280 million