Humanize { public static MaskFormat maskFormat(final String mask) { MaskFormat maskFmt = context.get().getMaskFormat(); maskFmt.setMask(mask); return maskFmt; } private  Humanize(); static String binaryPrefix(final Number value); @Expose static String binaryPrefix(final Number value, final Locale locale); static String camelize(final String text); static String camelize(final String text, final boolean capitalizeFirstChar); static String camelize(final String text, final boolean capitalizeFirstChar, final Locale locale); @Expose static String camelize(final String text, final Locale locale); static String capitalize(final String text); @Expose static String capitalize(final String text, final Locale locale); static DateFormat dateFormat(final String pattern); static DateFormat dateFormat(final String pattern, final Locale locale); @Expose static String decamelize(final String words); static String decamelize(final String words, final String replacement); static DecimalFormat decimalFormat(final String pattern); static DecimalFormat decimalFormat(final String pattern, final Locale locale); static String duration(final Number seconds); static String duration(final Number seconds, final Locale locale); static String duration(final Number seconds, final TimeStyle style); static String duration(final Number seconds, final TimeStyle style, final Locale locale); static String fixLength(final String text, final int charsNum, final char paddingChar); static String fixLength(final String text, final int charsNum, final char paddingChar, final boolean left); static String format(final Locale locale, final String pattern, final Object... args); static String format(final String pattern, final Object... args); static String formatCurrency(final Number value); static String formatCurrency(final Number value, final Locale locale); static String formatDate(final Date value); static String formatDate(final Date value, final Locale locale); static String formatDate(final Date value, final String pattern); static String formatDate(final Date value, final String pattern, final Locale locale); static String formatDate(final int style, final Date value); static String formatDate(final int style, final Date value, final Locale locale); static String formatDateTime(final Date value); static String formatDateTime(final Date value, final Locale locale); static String formatDateTime(final int dateStyle, final int timeStyle, final Date value); static String formatDateTime(final int dateStyle, final int timeStyle, final Date value, final Locale locale); static String formatDecimal(final Number value); static String formatDecimal(final Number value, final Locale locale); static String formatPercent(final Number value); static String formatPercent(final Number value, final Locale locale); static boolean lossyEquals(final Locale locale, final String source, final String target); static boolean lossyEquals(final String source, final String target); static String mask(final String mask, final String value); static MaskFormat maskFormat(final String mask); static MessageFormat messageFormat(final String pattern); static MessageFormat messageFormat(final String pattern, final Locale locale); static String metricPrefix(final Number value); @Expose static String metricPrefix(final Number value, final Locale locale); static String nanoTime(final Number value); @Expose static String nanoTime(final Number value, final Locale locale); static String naturalDay(Date then); @Expose static String naturalDay(Date then, Locale locale); static String naturalDay(int style, Date then); static String naturalDay(final int style, final Date then, final Locale locale); static String naturalTime(Date duration); static String naturalTime(Date reference, Date duration); static String naturalTime(final Date reference, final Date duration, final Locale locale); static String naturalTime(Date reference, Date duration, long precision); static String naturalTime(final Date reference, final Date duration, final long precision,
            final Locale locale); static String naturalTime(Date reference, Date duration, TimeMillis precision); static String naturalTime(final Date reference, final Date duration, final TimeMillis precision,
            final Locale locale); @Expose static String naturalTime(final Date duration, final Locale locale); static String naturalTime(Date duration, long precision); static String naturalTime(final Date duration, final long precision, final Locale locale); static String naturalTime(Date duration, TimeMillis precision); static String naturalTime(final Date duration, final TimeMillis precision, final Locale locale); static String ordinal(Number value); @Expose static String ordinal(final Number value, final Locale locale); static String oxford(Collection<?> items); static String oxford(Collection<?> items, int limit, String limitStr); @Expose static String oxford(Collection<?> items, Locale locale); static String oxford(Object[] items); static String oxford(final Object[] items, final int limit, final String limitStr); static String oxford(final Object[] items, final int limit, final String limitStr, final Locale locale); static String oxford(Object[] items, Locale locale); static Pace pace(final Number value, final long interval); static Pace pace(final Number value, final TimeMillis interval); static String paceFormat(final Locale locale, final Number value, final long interval); static String paceFormat(final Locale locale, final Number value, final PaceParameters params); static String paceFormat(final Number value, final long interval); static String paceFormat(final Number value, final PaceParameters params); static String paceFormat(final Number value, final TimeMillis interval); static byte[] parseBase64(String base64str); static Date parseISODate(String dateStr); static Date parseISODateTime(String dateStr); static Date parseISOTime(String timeStr); static Date parseSmartDate(String dateStr, String... fmts); static Date parseSmartDateWithSeparator(final String dateStr, final String separator, final String... fmts); static String pluralize(final Locale locale, final Number number, final PluralizeParams params); static String pluralize(final Number number, final PluralizeParams p); static String pluralize(final String one, final String many,
            final String none, final Number number, final Object... exts); static MessageFormat pluralizeFormat(final String template); static MessageFormat pluralizeFormat(final String template, final Locale locale); static MessageFormat pluralizeFormat(final String pattern, final String... choices); static PrettyTimeFormat prettyTimeFormat(); static PrettyTimeFormat prettyTimeFormat(final Locale locale); @Expose static String replaceSupplementary(final String value); static Number roundToSignificantFigures(Number num, int precision); @Expose static String simplify(final String text); @Expose static String slugify(final String text); static String slugify(final String text, final SlugifyParams params); static String spellBigNumber(final Number value); @Expose static String spellBigNumber(final Number value, final Locale locale); static String spellDigit(final Number value); @Expose static String spellDigit(final Number value, final Locale locale); static String times(final Number num); @Expose static String times(final Number num, final Locale locale); @Expose static String titleize(final String text); static String titleize(final String text, final String[] intCaps); @Expose static String underscore(final String text); @Expose static String unidecode(final String text); static String unmask(final String mask, final String value); static String wordWrap(final String value, final int len);  }
@Test(threadPoolSize = 10, invocationCount = 10) public void maskFormatTest() throws ParseException { int r = rand.nextInt(9); assertEquals(mask("_-__-_____/_", "A5881850" + r), "A-58-81850/" + r); assertEquals(mask("_# __ _____#-_", "A/5881850 " + r), "A 58 81850-" + r); assertEquals(mask("__ ____ _", r + "01100A"), r + "0 1100 A"); assertEquals(unmask("__ ____ _", r + "0 1100 A"), r + "01100A"); }