@@ -25,10 +25,6 @@ When you need a final field in your lambda, but you need the value to change lat
2525 may be the solution.
2626
2727``` kotlin
28-
29- /* *
30- *
31- */
3228public class MutableValueExample {
3329
3430 private static final MutableValue <String > publicKey = new MutableValue <> (null );
@@ -103,6 +99,7 @@ public class TransformerExample0 {
10399 counter.set(0L );
104100 counter.accept();
105101 var count = counter.get();
102+ assert count == 1 ;
106103 }
107104
108105 private static Consumer0 newLongCounter(MutableTransformer0 <Long > internal) {
@@ -126,6 +123,7 @@ public class TransformerExample1 {
126123 chainHash.set(System .currentTimeMillis());
127124 chainHash.accept(new Random ().nextLong());
128125 var hash = chainHash.get();
126+ assert hash != null ;
129127 }
130128
131129 private static Consumer1 <Long > newHashFunction(MutableTransformer1 <Long , Long > internal) {
@@ -146,7 +144,6 @@ public class TransformerExample1 {
146144}
147145```
148146
149-
150147### Transformer with Two Argument Consumer
151148
152149A simple 2 - dimension route distance total example.
@@ -161,6 +158,7 @@ public class TransformerExample2 {
161158 routeDistance.accept(1.0 , 1.0 );
162159 routeDistance.accept(4.0 , 6.0 );
163160 var distance = routeDistance.get();
161+ assert distance == 5.0 ;
164162 }
165163
166164 private static Consumer2 <Double , Double > newRouteFunction(MutableTransformer2 <Double , Double , Double > internal) {
0 commit comments