public static Date parseDate(String dateStr, String format) throws ParseException {
        if (StringUtils.isBlank(dateStr)) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.parse(dateStr);
    }
@Test
    public void testParseDate() throws ParseException {
        String dateStr = "2021-01-01";
        Date date = DateUtil.parseDate(dateStr, "yyyy-MM-dd");
        Assertions.assertNotNull(date);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Assertions.assertEquals(dateStr, sdf.format(date));
    }