diff --git a/libraries/pom.xml b/libraries/pom.xml
index c70db4ffb2..ddfd75da82 100644
--- a/libraries/pom.xml
+++ b/libraries/pom.xml
@@ -186,11 +186,11 @@
rome
${rome.version}
-
- io.specto
- hoverfly-java
- 0.8.0
-
+
+ io.specto
+ hoverfly-java
+ 0.8.0
+
org.apache.httpcomponents
httpclient
@@ -385,7 +385,7 @@
one.util
streamex
- 0.6.5
+ ${streamex.version}
org.jooq
@@ -472,11 +472,16 @@
noexception
1.1.0
-
+
org.eclipse.collections
eclipse-collections
${eclipse-collections.version}
+
+ io.vavr
+ vavr
+ ${vavr.version}
+
0.7.0
@@ -519,6 +524,8 @@
1.7.1
2.1.2
1.0
- 8.2.0
+ 8.2.0
+ 0.6.5
+ 0.9.0
diff --git a/libraries/src/main/java/com/baeldung/distinct/DistinctWithJavaFunction.java b/libraries/src/main/java/com/baeldung/distinct/DistinctWithJavaFunction.java
new file mode 100644
index 0000000000..0d08c94b47
--- /dev/null
+++ b/libraries/src/main/java/com/baeldung/distinct/DistinctWithJavaFunction.java
@@ -0,0 +1,15 @@
+package com.baeldung.distinct;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+public class DistinctWithJavaFunction {
+
+ public static Predicate distinctByKey(Function super T, ?> keyExtractor) {
+ Map