class PreJava9DateFormatProvider {
  private PreJava9DateFormatProvider() {}

  /**
   * Returns the same DateFormat as {@code DateFormat.getDateTimeInstance(dateStyle, timeStyle,
   * Locale.US)} in Java 8 or below.
   */
  public static DateFormat getUsDateTimeFormat(int dateStyle, int timeStyle) {
    String pattern =
        getDatePartOfDateTimePattern(dateStyle) + " " + getTimePartOfDateTimePattern(timeStyle);
    return new SimpleDateFormat(pattern, Locale.US);
  }

  private static String getDatePartOfDateTimePattern(int dateStyle) {<FILL_FUNCTION_BODY>}

  private static String getTimePartOfDateTimePattern(int timeStyle) {
    switch (timeStyle) {
      case DateFormat.SHORT:
        return "h:mm a";
      case DateFormat.MEDIUM:
        return "h:mm:ss a";
      case DateFormat.FULL:
      case DateFormat.LONG:
        return "h:mm:ss a z";
      default:
        throw new IllegalArgumentException("Unknown DateFormat style: " + timeStyle);
    }
  }
}

    switch (dateStyle) {
      case DateFormat.SHORT:
        return "M/d/yy";
      case DateFormat.MEDIUM:
        return "MMM d, yyyy";
      case DateFormat.LONG:
        return "MMMM d, yyyy";
      case DateFormat.FULL:
        return "EEEE, MMMM d, yyyy";
      default:
        throw new IllegalArgumentException("Unknown DateFormat style: " + dateStyle);
    }
  
<no_super_class>