### Question:
Util { public static Calendar getCalendarForLocale(Calendar oldCalendar, Locale locale) { if (locale == null) throw new IllegalArgumentException("You must specify the Locate value"); if (oldCalendar == null) return Calendar.getInstance(locale); long currentTimeMillis = oldCalendar.getTimeInMillis(); Calendar newCalendar = Calendar.getInstance(locale); newCalendar.setTimeInMillis(currentTimeMillis); return newCalendar; }  static Calendar getCalendarForLocale(Calendar oldCalendar, Locale locale); static boolean isNumericMonths(String[] value);  }### Answer:
@Test public void getCalendarByLocaleDefault() { Locale locale = Locale.getDefault(); Calendar calendar = Util.getCalendarForLocale(null, locale); assertNotNull(calendar); }
@Test public void getCalendarByLocale() { Locale locale = new Locale("en", "US"); Calendar calendar = Calendar.getInstance(locale); Calendar result = Util.getCalendarForLocale(calendar, locale); assertEquals(result.getTime(), result.getTime()); }
@Test(expected = IllegalArgumentException.class) public void getCalendarByNullLocale() { Util.getCalendarForLocale(Calendar.getInstance(), null); }