55
66import scala .runtime .*;
77import static scala .runtime .test .TestAPI .*;
8- import static scala .runtime .F .func ;
9- import static scala .runtime .F .proc ;
8+ import static scala .runtime .F .*;
109
1110public class Test {
1211 public static void main (String [] args ) {
@@ -61,7 +60,7 @@ public static void main(String[] args) {
6160 // as are `curried`, `tupled`, `compose`, `andThen`.
6261 f3 .compose (f3 ).andThen (f3 ).apply ("" );
6362 scala .Function2 <String , String , String > f6 = func ((s1 , s2 ) -> join (s1 , s2 ));
64- assert (f6 .curried ().apply ("1" ).apply ("2" ) == "12" );
63+ assert (f6 .curried ().apply ("1" ).apply ("2" ). equals ( "12" ) );
6564
6665 // Functions returning unit must use the `P1`, ... functional interfaces
6766 // in order to convert a void lamdba return to Scala's Unit.
@@ -76,20 +75,20 @@ public static void main(String[] args) {
7675
7776 // Function0 is also available
7877 scala .Function0 <String > f9 = F .f0 (() -> "42" );
79- assert (f9 .apply () == "42" );
78+ assert (f9 .apply (). equals ( "42" ) );
8079
8180 // You can go up to 22 (the highest arity function defined in the Scala standard library.)
82- assert (acceptFunction1 (func (v1 -> v1 .toUpperCase ())) == "1" );
81+ assert (acceptFunction1 (func (v1 -> v1 .toUpperCase ())). equals ( "1" ) );
8382 acceptFunction1Unit (proc (v1 -> sideEffect ()));
8483 acceptFunction1Unit (proc (v1 -> {v1 .toUpperCase (); return ;}));
8584
86- assert (acceptFunction2 (func ((v1 , v2 ) -> join (v1 , v2 ))) == "12" );
85+ assert (acceptFunction2 (func ((v1 , v2 ) -> join (v1 , v2 ))). equals ( "12" ) );
8786 acceptFunction2Unit (proc ((v1 , v2 ) -> {v1 .toUpperCase (); return ;}));
8887
89- assert (acceptFunction3 (func ((v1 , v2 , v3 ) -> join (v1 , v2 , v3 ))) == "123" );
88+ assert (acceptFunction3 (func ((v1 , v2 , v3 ) -> join (v1 , v2 , v3 ))). equals ( "123" ) );
9089 acceptFunction3Unit (proc ((v1 , v2 , v3 ) -> {v1 .toUpperCase (); return ;}));
9190
92- assert (acceptFunction22 (func ((v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11 , v12 , v13 , v14 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v22 ) -> join (v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11 , v12 , v13 , v14 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v22 ))) == "12345678910111213141516171819202122" );
91+ assert (acceptFunction22 (func ((v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11 , v12 , v13 , v14 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v22 ) -> join (v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11 , v12 , v13 , v14 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v22 ))). equals ( "12345678910111213141516171819202122" ) );
9392 acceptFunction22Unit ( proc ((v1 , v2 , v3 , v4 , v5 , v6 , v7 , v8 , v9 , v10 , v11 , v12 , v13 , v14 , v15 , v16 , v17 , v18 , v19 , v20 , v21 , v22 ) -> {v1 .toUpperCase (); return ;}));
9493 }
9594
0 commit comments