### Question:
DateUtil { public static String dateToString(Date date, String dateFromat) { SimpleDateFormat formatter = new SimpleDateFormat(dateFromat); return formatter.format(date).toString(); }  Date getDateFromNow(int days); Date getDateFromNow(int days, int hours, int minutes); static String dateToString(Date date, String dateFromat); Date getDateFromGivenDate(Date date, int days, int hours,int minutes, int second); Date addTimeOffset(Date date, int mins); static Date getUTCDate(); static Date getUTCDate(long epoh); static Date stringToDate(String dateString, String dateFromat);  }### Answer:
@Test public void testDateToString() { Date date = new Date(); SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yyyy"); String dateFromat = DATE_FORMAT.format(date); String dateCheck = DateUtil.dateToString(date, dateFromat); Assert.assertEquals(dateCheck,dateFromat); }