diff --git a/easy-random/pom.xml b/easy-random/pom.xml
new file mode 100644
index 0000000000..61f0ed2cd4
--- /dev/null
+++ b/easy-random/pom.xml
@@ -0,0 +1,23 @@
+
+
+ 4.0.0
+ easy-random
+ easy-random
+
+
+ parent-modules
+ com.baeldung
+ 1.0.0-SNAPSHOT
+
+
+
+
+ org.jeasy
+ easy-random-core
+ 4.0.0
+
+
+
+
\ No newline at end of file
diff --git a/easy-random/src/main/java/org/baeldung/easy/random/model/Department.java b/easy-random/src/main/java/org/baeldung/easy/random/model/Department.java
new file mode 100644
index 0000000000..ee4dc82771
--- /dev/null
+++ b/easy-random/src/main/java/org/baeldung/easy/random/model/Department.java
@@ -0,0 +1,17 @@
+package org.baeldung.easy.random.model;
+
+import java.util.StringJoiner;
+
+public class Department {
+ private String depName;
+
+ public Department(String depName) {
+ this.depName = depName;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(", ", Department.class.getSimpleName() + "[", "]").add("depName='" + depName + "'")
+ .toString();
+ }
+}
diff --git a/easy-random/src/main/java/org/baeldung/easy/random/model/Employee.java b/easy-random/src/main/java/org/baeldung/easy/random/model/Employee.java
new file mode 100644
index 0000000000..ef63642ca2
--- /dev/null
+++ b/easy-random/src/main/java/org/baeldung/easy/random/model/Employee.java
@@ -0,0 +1,70 @@
+package org.baeldung.easy.random.model;
+
+import java.util.*;
+
+public class Employee {
+
+ private long id;
+ private String firstName;
+ private String lastName;
+ private Department department;
+ private Collection coworkers;
+ private Map quarterGrades;
+
+ public Employee(long id, String firstName, String lastName, Department department) {
+ this.id = id;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.department = department;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ Employee employee = (Employee) o;
+ return id == employee.id;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public Department getDepartment() {
+ return department;
+ }
+
+ public Collection getCoworkers() {
+ return Collections.unmodifiableCollection(coworkers);
+ }
+
+ public Map getQuarterGrades() {
+ return Collections.unmodifiableMap(quarterGrades);
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(", ", Employee.class.getSimpleName() + "[", "]").add("id=" + id)
+ .add("firstName='" + firstName + "'")
+ .add("lastName='" + lastName + "'")
+ .add("department=" + department)
+ .add("coworkers size=" + ((coworkers == null) ? 0 : coworkers.size()))
+ .add("quarterGrades=" + quarterGrades)
+ .toString();
+ }
+}
diff --git a/easy-random/src/main/java/org/baeldung/easy/random/model/Grade.java b/easy-random/src/main/java/org/baeldung/easy/random/model/Grade.java
new file mode 100644
index 0000000000..cb979be3b8
--- /dev/null
+++ b/easy-random/src/main/java/org/baeldung/easy/random/model/Grade.java
@@ -0,0 +1,22 @@
+package org.baeldung.easy.random.model;
+
+import java.util.StringJoiner;
+
+public class Grade {
+
+ private int grade;
+
+ public Grade(int grade) {
+ this.grade = grade;
+ }
+
+ public int getGrade() {
+ return grade;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(", ", Grade.class.getSimpleName() + "[", "]").add("grade=" + grade)
+ .toString();
+ }
+}
diff --git a/easy-random/src/main/java/org/baeldung/easy/random/model/Person.java b/easy-random/src/main/java/org/baeldung/easy/random/model/Person.java
new file mode 100644
index 0000000000..c941499993
--- /dev/null
+++ b/easy-random/src/main/java/org/baeldung/easy/random/model/Person.java
@@ -0,0 +1,30 @@
+package org.baeldung.easy.random.model;
+
+import java.util.StringJoiner;
+
+public class Person {
+
+ private String firstName;
+ private String lastName;
+ private Integer age;
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(", ", Person.class.getSimpleName() + "[", "]").add("firstName='" + firstName + "'")
+ .add("lastName='" + lastName + "'")
+ .add("age=" + age)
+ .toString();
+ }
+}
diff --git a/easy-random/src/main/java/org/baeldung/easy/random/model/YearQuarter.java b/easy-random/src/main/java/org/baeldung/easy/random/model/YearQuarter.java
new file mode 100644
index 0000000000..c2868f09b8
--- /dev/null
+++ b/easy-random/src/main/java/org/baeldung/easy/random/model/YearQuarter.java
@@ -0,0 +1,50 @@
+package org.baeldung.easy.random.model;
+
+import java.time.LocalDate;
+import java.util.Objects;
+import java.util.StringJoiner;
+
+public class YearQuarter {
+
+ private LocalDate startDate;
+ private LocalDate endDate;
+
+ public YearQuarter(LocalDate startDate) {
+ this.startDate = startDate;
+ autoAdjustEndDate();
+ }
+
+ private void autoAdjustEndDate() {
+ endDate = startDate.plusMonths(3L);
+ }
+
+ public LocalDate getStartDate() {
+ return startDate;
+ }
+
+ public LocalDate getEndDate() {
+ return endDate;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ YearQuarter quarter = (YearQuarter) o;
+ return Objects.equals(startDate, quarter.startDate) && Objects.equals(endDate, quarter.endDate);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(startDate, endDate);
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(", ", YearQuarter.class.getSimpleName() + "[", "]").add("startDate=" + startDate)
+ .add("endDate=" + endDate)
+ .toString();
+ }
+}
diff --git a/easy-random/src/main/java/org/baeldung/easy/random/randomizer/YearQuarterRandomizer.java b/easy-random/src/main/java/org/baeldung/easy/random/randomizer/YearQuarterRandomizer.java
new file mode 100644
index 0000000000..05232ffcbc
--- /dev/null
+++ b/easy-random/src/main/java/org/baeldung/easy/random/randomizer/YearQuarterRandomizer.java
@@ -0,0 +1,18 @@
+package org.baeldung.easy.random.randomizer;
+
+import org.baeldung.easy.random.model.YearQuarter;
+import org.jeasy.random.api.Randomizer;
+
+import java.time.LocalDate;
+import java.time.Month;
+
+public class YearQuarterRandomizer implements Randomizer {
+
+ private LocalDate date = LocalDate.of(1990, Month.SEPTEMBER, 25);
+
+ @Override
+ public YearQuarter getRandomValue() {
+ date = date.plusMonths(3);
+ return new YearQuarter(date);
+ }
+}
diff --git a/easy-random/src/test/java/org/baeldung/easy/random/EasyRandomUnitTest.java b/easy-random/src/test/java/org/baeldung/easy/random/EasyRandomUnitTest.java
new file mode 100644
index 0000000000..9f7a23db66
--- /dev/null
+++ b/easy-random/src/test/java/org/baeldung/easy/random/EasyRandomUnitTest.java
@@ -0,0 +1,63 @@
+package org.baeldung.easy.random;
+
+import org.baeldung.easy.random.model.Employee;
+import org.baeldung.easy.random.model.Person;
+import org.baeldung.easy.random.model.YearQuarter;
+import org.baeldung.easy.random.randomizer.YearQuarterRandomizer;
+import org.jeasy.random.EasyRandom;
+import org.jeasy.random.EasyRandomParameters;
+import org.jeasy.random.FieldPredicates;
+import org.jeasy.random.TypePredicates;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class EasyRandomUnitTest {
+
+ @Test
+ void givenDefaultConfiguration_thenGenerateSingleObject() {
+ EasyRandom generator = new EasyRandom();
+ Person person = generator.nextObject(Person.class);
+
+ assertNotNull(person.getAge());
+ assertNotNull(person.getFirstName());
+ assertNotNull(person.getLastName());
+ }
+
+ @Test
+ void givenDefaultConfiguration_thenGenerateObjectsList() {
+ EasyRandom generator = new EasyRandom();
+ List persons = generator.objects(Person.class, 5)
+ .collect(Collectors.toList());
+
+ assertEquals(5, persons.size());
+ }
+
+ @Test
+ void givenCustomConfiguration_thenGenerateSingleEmployee() {
+ EasyRandomParameters parameters = new EasyRandomParameters();
+ parameters.stringLengthRange(3, 3);
+ parameters.collectionSizeRange(5, 5);
+ parameters.excludeField(FieldPredicates.named("lastName").and(FieldPredicates.inClass(Employee.class)));
+ parameters.excludeType(TypePredicates.inPackage("not.existing.pkg"));
+ parameters.randomize(YearQuarter.class, new YearQuarterRandomizer());
+
+ EasyRandom generator = new EasyRandom(parameters);
+ Employee employee = generator.nextObject(Employee.class);
+
+ assertEquals(3, employee.getFirstName().length());
+ assertEquals(5, employee.getCoworkers().size());
+ assertEquals(5, employee.getQuarterGrades().size());
+ assertNotNull(employee.getDepartment());
+
+ assertNull(employee.getLastName());
+
+ for (YearQuarter key : employee.getQuarterGrades().keySet()) {
+ assertEquals(key.getStartDate(), key.getEndDate().minusMonths(3L));
+ }
+ }
+
+}
diff --git a/pom.xml b/pom.xml
index 982c52c54e..6365e407f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -422,6 +422,7 @@
drools
dubbo
+ easy-random
ethereum
feign