File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
approvaltests-util-tests/src/test/java/org/lambda/query
approvaltests-util/src/main/java/org/lambda/query Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -183,4 +183,10 @@ void testJoin()
183183 String result = Queryable .as ("hello" , null , "world" ).join ("_" );
184184 assertEquals ("hello_null_world" , result );
185185 }
186+ @ Test
187+ void testJoinWithTransformation ()
188+ {
189+ String result = Queryable .as ("Hello" , "World" ).join ("_" , String ::toUpperCase );
190+ assertEquals ("HELLO_WORLD" , result );
191+ }
186192}
Original file line number Diff line number Diff line change @@ -165,4 +165,8 @@ public String join(String joinCharacter)
165165 {
166166 return String .join (joinCharacter , this .select (t -> "" + t ));
167167 }
168+ public <Out > String join (String joinCharacter , Function1 <In , Out > transformer )
169+ {
170+ return String .join (joinCharacter , this .select (t -> "" + transformer .call (t )));
171+ }
168172}
You can’t perform that action at this time.
0 commit comments