public static < T > List < T > concat ( List < T > inputs , T newValue ) { List < T > outputs = new ArrayList <> ( inputs . size ( ) + 1 ) ; outputs . addAll ( inputs ) ; outputs . add ( newValue ) ; return outputs ; }
Concat new value to existing inputs and returns new outputs . Note that input is not modified .