@Test
public void testStringToDate(){

        String dateString = "2018-05-31";
        String dateFormat = "yyyy-MM-dd";
        Calendar cal = Calendar.getInstance();
                        cal.set(2018 - 1900, 04, 31);
                        Date expectedDate = new Date(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH),cal.get(Calendar.DATE));
        Date actualDate = dateUtil.stringToDate(dateString, dateFormat);
        if(actualDate != null){
                Assert.assertEquals(expectedDate.getYear(), actualDate.getYear());
                                Assert.assertEquals(expectedDate.getDay(), actualDate.getDay());
                                Assert.assertEquals(expectedDate.getMonth(), actualDate.getMonth());
        }
}