public static < S > List < S > of ( S left , List < ? extends S > right ) { if ( right . isEmpty ( ) ) { return Collections . singletonList ( left ) ; } else { List < S > list = new ArrayList < S > ( 1 + right . size ( ) ) ; list . add ( left ) ; list . addAll ( right ) ; return list ; } }
Creates a list of a single element and another list .