public static String getDateFormatByRegex( String regex ) {
    return getDateFormatByRegex( regex, null );
  }
@Test
  public void testGetDateFormatByRegexLocale() {
    assertNull( DateDetector.getDateFormatByRegex( null, null ) );
    assertNull( DateDetector.getDateFormatByRegex( null, LOCALE_en_US ) );
    // return eu if we pass en_US regexp without locale
    assertEquals( SAMPLE_DATE_FORMAT, DateDetector.getDateFormatByRegex( SAMPLE_REGEXP_US ) );
    assertEquals( SAMPLE_DATE_FORMAT_US, DateDetector.getDateFormatByRegex( SAMPLE_REGEXP_US, LOCALE_en_US ) );
  }