diff --git a/javaslang/pom.xml b/javaslang/pom.xml
index e111132aec..7bb23c0daf 100644
--- a/javaslang/pom.xml
+++ b/javaslang/pom.xml
@@ -22,8 +22,17 @@
javaslang
2.1.0-alpha
+
+ io.javaslang
+ javaslang-test
+ ${javaslang.test.version}
+
+
+ 2.0.5
+
+
diff --git a/javaslang/src/test/java/com/baeldung/javaslang/PropertyBasedTest.java b/javaslang/src/test/java/com/baeldung/javaslang/PropertyBasedTest.java
new file mode 100644
index 0000000000..3acac34550
--- /dev/null
+++ b/javaslang/src/test/java/com/baeldung/javaslang/PropertyBasedTest.java
@@ -0,0 +1,69 @@
+package com.baeldung.javaslang;
+
+
+import javaslang.CheckedFunction1;
+import javaslang.collection.Stream;
+import javaslang.test.Arbitrary;
+import javaslang.test.CheckResult;
+import javaslang.test.Property;
+import org.junit.Test;
+
+public class PropertyBasedTest {
+
+ public Stream stringsSupplier() {
+ return Stream.from(0).map(i -> {
+ boolean divByTwo = i % 2 == 0;
+ boolean divByFive = i % 5 == 0;
+
+ if(divByFive && divByTwo){
+ return "DividedByTwoAndFiveWithoutRemainder";
+ }else if(divByFive){
+ return "DividedByFiveWithoutRemainder";
+ }else if(divByTwo){
+ return "DividedByTwoWithoutRemainder";
+ }
+ return "";
+ });
+ }
+
+ @Test
+ public void givenArbitrarySeq_whenCheckThatEverySecondElementIsEqualToString_thenTestPass() {
+ //given
+ Arbitrary multiplesOf2 = Arbitrary.integer()
+ .filter(i -> i > 0)
+ .filter(i -> i % 2 == 0 && i % 5 != 0);
+
+ //when
+ CheckedFunction1 mustEquals =
+ i -> stringsSupplier().get(i).equals("DividedByTwoWithoutRemainder");
+
+
+ //then
+ CheckResult result = Property
+ .def("Every second element must equal to DividedByTwoWithoutRemainder")
+ .forAll(multiplesOf2)
+ .suchThat(mustEquals)
+ .check(10_000, 100);
+
+ result.assertIsSatisfied();
+ }
+
+ @Test
+ public void givenArbitrarySeq_whenCheckThatEveryFifthElementIsEqualToString_thenTestPass() {
+ //given
+ Arbitrary multiplesOf5 = Arbitrary.integer()
+ .filter(i -> i > 0)
+ .filter(i -> i % 5 == 0 && i % 2 == 0);
+
+ //when
+ CheckedFunction1 mustEquals = i ->
+ stringsSupplier().get(i).endsWith("DividedByTwoAndFiveWithoutRemainder");
+
+ //then
+ Property.def("Every fifth element must equal to DividedByTwoAndFiveWithoutRemainder")
+ .forAll(multiplesOf5)
+ .suchThat(mustEquals)
+ .check(10_000, 1_000)
+ .assertIsSatisfied();
+ }
+}