code: private static DateFormat get(int dateStyle, int timeStyle, ULocale loc, Calendar cal) {
          if((timeStyle != DateFormat.NONE && (timeStyle & RELATIVE)>0) ||
             (dateStyle != DateFormat.NONE && (dateStyle & RELATIVE)>0)) {
              RelativeDateFormat r = new RelativeDateFormat(timeStyle, dateStyle /* offset? */, loc, cal);
              return r;
          }
  
          if (timeStyle < DateFormat.NONE || timeStyle > DateFormat.SHORT) {
              throw new IllegalArgumentException("Illegal time style " + timeStyle);
          }
          if (dateStyle < DateFormat.NONE || dateStyle > DateFormat.SHORT) {
              throw new IllegalArgumentException("Illegal date style " + dateStyle);
          }
  
          if (cal == null) {
              cal = Calendar.getInstance(loc);
          }
  
          try {
              DateFormat result = cal.getDateTimeFormat(dateStyle, timeStyle, loc);
              result.setLocale(cal.getLocale(ULocale.VALID_LOCALE),
                   cal.getLocale(ULocale.ACTUAL_LOCALE));
              return result;
          } catch (MissingResourceException e) {
              ///CLOVER:OFF
              // coverage requires separate run with no data, so skip
              return new SimpleDateFormat("M/d/yy h:mm a");
              ///CLOVER:ON
          }
      }
docs: Creates a DateFormat with the given time and/or date style in the given
  locale.
  @param dateStyle a value from 0 to 3 indicating the time format,
  or -1 to indicate no date
  @param timeStyle a value from 0 to 3 indicating the time format,
  or -1 to indicate no time
  @param loc the locale for the format
  @param cal the calendar to be used, or null