class CommonUtils {

    public static Date getDateFromString(final String dateInString, final String format)
            throws java.text.ParseException {
        String dateDormatter = "MM/dd/yyyy";
        if (!StringUtils.isNullOrEmpty(format)) {
            dateDormatter = format;
        }
        SimpleDateFormat formatter = new SimpleDateFormat(dateDormatter);
        return formatter.parse(dateInString);
    }

}