protected boolean looksLikeISO8601(String dateStr){
  if (dateStr.length() >= 5 && Character.isDigit(dateStr.charAt(0)) && Character.isDigit(dateStr.charAt(3)) && dateStr.charAt(4) == '-') {
    return true;
  }
  return false;
}

protected boolean looksLikeISO8601 ( String dateStr ) { if ( dateStr . length ( ) >= 5 && Character . isDigit ( dateStr . charAt ( 0 ) ) && Character . isDigit ( dateStr . charAt ( 3 ) ) && dateStr . charAt ( 4 ) == '-' ) { return true ; } return false ; }
overridable helper method used to figure out which of supported formats is the likeliest match .
