Future in Vavr - Initial Commit

This commit is contained in:
Ahmed Tawila 2017-11-29 09:06:30 +02:00
parent 992c661e56
commit 5f0eed9502

View File

@ -0,0 +1,22 @@
package com.baeldung.vavr.future;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import io.vavr.concurrent.Future;
public class Tester {
@Test
public void start() {
Future<Integer> resultFuture = Future.of(() -> addOne(4));
Integer result = resultFuture.get();
assertEquals(5, (int) result);
}
public Integer addOne(Integer num) {
return num + 1;
}
}