I have the following code in Java.
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
String expiryDateInString = "05/14/86";
final Instant expiryDate = dateFormat.parse((expiryDateInString)).toInstant();
I want this to cause a parse exception but i am getting a year parsed as 0086, which i believe is way in the past. How can i make the year to be a strictly 4 digit year and anything else will give an exception.