TextUtil { public static String getCaptionLine(final List<String> headers, final List<? extends Class<?>> headerClasses, final String delim) { StringBuffer buffer = new StringBuffer(); int i = 0; for (String h : headers) { buffer.append(headerClasses == null || headerClasses.isEmpty() ? h : formatHeader(h, headerClasses.get(i))); if (i < headers.size() - 1) { buffer.append(delim); } i++; } return buffer.toString(); }  static String getCaptionLine(final List<String> headers, final List<? extends Class<?>> headerClasses,
            final String delim); static String getTxtLine(final List<?> objects, final List<String> headers, final String delimeter,
            final boolean includeFieldNames); static String getTxtLine(final Object obj); static String getTxtLine(final Object obj, final String delimeter); static String getTxtLine(final Object obj, final String[] properties); static String getTxtLine(final Object obj, final String delimeter, final String[] properties); static String getTxtLine(final Object obj, final String delimeter, final String[] properties,
            final boolean includeFieldNames); @SuppressWarnings({ "rawtypes", "unchecked" }) static String getTxtLine(final F obj, final String delimeter, final String[] properties,
            final boolean includeFieldNames, final LinkedHashMap<String, Function<? extends F, String>> virtualProps); static String getTxtLine(final F obj, final String[] properties,
            final LinkedHashMap<String, Function<? extends F, String>> virtualProps); static String getCaptionLine(final Class<?> clazz); static String getCaptionLine(final Class<?> clazz, final String delimeter); static String getCaptionLine(final Class<?> clazz, final String[] properties); static String getCaptionLine(final Class<?> clazz, final String delimeter, final String[] properties); static String getCaptionLine(final Class<?> clazz, final String delimeter, final String[] properties,
            final String[] virtualProps); static String getCaptionLine(final Class<?> clazz, final String[] properties, final String[] virtualProps); static String getCaptionLine(final Class<?> clazz, final String[] properties, Iterable<String> virtualProps); static String toString(final Object obj); static DateFormat getDateFormat(); static DateFormat getTimeFormat(); static String getReadableTime(double time); static final DecimalFormat DEC_FORMAT; static final int SIZE_OF_DBL_STRINGS; static final int SIZE_OF_INT_STRINGS; static final int SIZE_OF_STRINGS; static final String NEW_LINE; static final String DEFAULT_DELIM; }
@Test public void testGetCaptionLine() { String line = TextUtil.getCaptionLine(X.class, ";"); assertEquals(clean("LstInts;LstStr; X;Y;Class"), clean(line)); line = TextUtil.getCaptionLine(ExtendsXNoAnno.class, "|"); assertEquals(clean("Prop|LstInts|LstStr| X|Y|Class"), clean(line)); line = TextUtil.getCaptionLine(ExtendsXAnno.class, "|"); assertEquals(clean("Prop|Y"), clean(line)); line = TextUtil.getCaptionLine(ExtendsXNoAnno.class, "|", new String[] { "X", "Prop" }); assertEquals(clean("X|Prop"), clean(line)); line = TextUtil.getCaptionLine(ExtendsXAnno.class, "|", new String[] { "X", "LstStr" }); assertEquals(clean("X|LstStr"), clean(line)); }