public static List < String > concat ( List < String > elements , String text , boolean append ) { List < String > concats = new ArrayList < String > ( ) ; for ( String element : elements ) { concats . add ( append ? element + text : text + element ) ; } return concats ; }
Utility method to concatenate a String to a list of Strings . The text can be either appended or prepended .