I need this below code to start failing when the provided date string doesn't match the given format 100%.
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
format.setLenient(false);
format.parse("09/10/20144");
For some reason even with setLenient(false) this call returns an actual 09/10/20144 date. I tried passing "new ParsePosition(0)" to the parse call but that doesn't help at all since the date still returns as 09/10/20144. I need any exceptions from the exact date format to fail hard. Is there any good way of doing that?