### Question:
EgovDateUtil { public static Date dateFormatCheck(String source) throws ParseException { return dateFormatCheck(source, "yyyyMMdd"); } protected  EgovDateUtil(); static String getCalcDateAsString(String sYearPara,
            String sMonthPara, String sDayPara, int iTerm, String sGuBun); static String getCalcYearAsString(String sYearPara,
            String sMonthPara, String sDayPara, int iTerm, String sGuBun); static String getCalcMonthAsString(String sYearPara,
            String sMonthPara, String sDayPara, int iTerm, String sGuBun); static String getCalcDayAsString(String sYearPara,
            String sMonthPara, String sDayPara, int iTerm, String sGuBun); static int getCalcYearAsInt(String sYearPara, String sMonthPara,
            String sDayPara, int iTerm, String sGuBun); static int getCalcMonthAsInt(String sYearPara, String sMonthPara,
            String sDayPara, int iTerm, String sGuBun); static int getCalcDayAsInt(String sYearPara, String sMonthPara,
            String sDayPara, int iTerm, String sGuBun); static int getCurrentYearAsInt(); static int getCurrentMonthAsInt(); static int getCurrentDayAsInt(); static int getCurrentHourAsInt(); static int getCurrentMinuteAsInt(); static int getCurrentMilliSecondAsInt(); static String getCurrentYearAsString(); static String getCurrentMonthAsString(); static String getCurrentDayAsString(); static String getCurrentHourAsString(); static String getCurrentMinuteAsString(); static String getCurrentSecondAsString(); static String getCurrentMilliSecondAsString(); static String getCurrentDateAsString(); static String getCurrentTimeAsString(); static String getCurrentDateTimeAsString(); static String getDayOfWeekAsString(String sYear, String sMonth,
            String sDay); static int getFullAge(String socialNo, String keyDate); static int getCurrentFullAge(String socialNo); static int getDayCountForMonth(int year, int month); static int getDayCount(String from, String to); static Date dateFormatCheck(String source); static Date dateFormatCheck(String source, String format); static int getDayCountWithFormatter(String from, String to,
            String format); static long getTimeCount(String from, String to); static long getTimeCount(String from, String to, String format); static int getDayOfWeekCount(String from, String to, String yoil); static String toString(Date date, String format, Locale locale);  }### Answer:
@Test public void testDateFormatCheck() throws Exception { assertNotNull(EgovDateUtil.dateFormatCheck("20090301")); Class<Exception> exceptionClass = null; try { Date dateFormatCheck = EgovDateUtil.dateFormatCheck("20090300"); } catch (Exception e) { log.error("### Exception : " + e.toString()); exceptionClass = (Class<Exception>) e.getClass(); } finally { assertEquals(ParseException.class, exceptionClass); } exceptionClass = null; try { Date dateFormatCheck = EgovDateUtil.dateFormatCheck("20090229"); } catch (Exception e) { log.error("### Exception : " + e.toString()); exceptionClass = (Class<Exception>) e.getClass(); } finally { assertEquals(ParseException.class, exceptionClass); } assertNotNull(EgovDateUtil.dateFormatCheck("2009/03/01", "yyyy/MM/dd")); assertNotNull(EgovDateUtil.dateFormatCheck("2009-03-01", "yyyy-MM-dd")); exceptionClass = null; try { Date dateFormatCheck = EgovDateUtil.dateFormatCheck("2009/03/01"); } catch (Exception e) { log.error("### Exception : " + e.toString()); exceptionClass = (Class<Exception>) e.getClass(); } finally { assertEquals(ParseException.class, exceptionClass); } }