class LoaderUtils {

  public static LocalDate parseDate(String str, DateTimeFormatter... formatters) {
    ArgChecker.notEmpty(formatters, "formatters");
    for (DateTimeFormatter formatter : formatters) {
      try {
        ParsePosition pp = new ParsePosition(0);
        formatter.parseUnresolved(str, pp);
        int len = str.length();
        if (pp.getErrorIndex() == -1 && pp.getIndex() == len) {
          return formatter.parse(str, LocalDate::from);
        }
      } catch (RuntimeException ex) {
        // should not happen, but ignore if it does
      }
    }
    throw new IllegalArgumentException("Unknown date format: " + str);
  }

  private  LoaderUtils();

}