diff --git a/core-java-modules/core-java-streams-collect/README.md b/core-java-modules/core-java-streams-collect/README.md
new file mode 100644
index 0000000000..97c76dc431
--- /dev/null
+++ b/core-java-modules/core-java-streams-collect/README.md
@@ -0,0 +1,2 @@
+## Relevant Articles:
+
diff --git a/core-java-modules/core-java-streams-collect/pom.xml b/core-java-modules/core-java-streams-collect/pom.xml
new file mode 100644
index 0000000000..c60cf2ab93
--- /dev/null
+++ b/core-java-modules/core-java-streams-collect/pom.xml
@@ -0,0 +1,43 @@
+
+
+ 4.0.0
+ core-java-streams-4
+ 0.1.0-SNAPSHOT
+ core-java-streams-collect
+ jar
+
+
+ com.baeldung.core-java-modules
+ core-java-modules
+ 0.0.1-SNAPSHOT
+
+
+
+
+ log4j
+ log4j
+ ${log4j.version}
+
+
+ org.junit
+ junit-bom
+ ${junit-jupiter.version}
+ pom
+ import
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+
+
+
+ 3.23.1
+
+
+
diff --git a/core-java-modules/core-java-streams-collect/src/test/java/com/baeldung/collect/nullable/CanCollectReturnNullUnitTest.java b/core-java-modules/core-java-streams-collect/src/test/java/com/baeldung/collect/nullable/CanCollectReturnNullUnitTest.java
new file mode 100644
index 0000000000..cf02f1d5ea
--- /dev/null
+++ b/core-java-modules/core-java-streams-collect/src/test/java/com/baeldung/collect/nullable/CanCollectReturnNullUnitTest.java
@@ -0,0 +1,92 @@
+package com.baeldung.collect.nullable;
+
+import static java.util.stream.Collectors.collectingAndThen;
+import static java.util.stream.Collectors.groupingBy;
+import static java.util.stream.Collectors.toList;
+import static java.util.stream.Collectors.toMap;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+import java.util.stream.Collector;
+
+import org.junit.jupiter.api.Test;
+
+public class CanCollectReturnNullUnitTest {
+ private final List LANGUAGES = Arrays.asList("Kotlin", null, null, "Java", "Python", "Rust");
+
+ @Test
+ void givenAStreamWithNullElements_whenCollect_shouldReturnNotNull() {
+ List result = LANGUAGES.stream()
+ .filter(Objects::isNull)
+ .collect(toList());
+ assertNotNull(result);
+ assertEquals(Arrays.asList(null, null), result);
+ }
+
+ @Test
+ void givenAStreamWithNullElements_whenCollectEmptyStream_shouldReturnNotNull() {
+ List result = LANGUAGES.stream()
+ .filter(s -> s != null && s.length() == 1)
+ .collect(toList());
+ assertNotNull(result);
+ assertTrue(result.isEmpty());
+
+ Map result2 = LANGUAGES.stream()
+ .filter(s -> s != null && s.length() == 1)
+ .collect(toMap(s -> s.charAt(0), Function.identity()));
+ assertNotNull(result2);
+ assertTrue(result2.isEmpty());
+
+ Map> result3 = LANGUAGES.stream()
+ .filter(s -> s != null && s.length() == 1)
+ .collect(groupingBy(s -> s.charAt(0)));
+ assertNotNull(result3);
+ assertTrue(result3.isEmpty());
+ }
+
+ @Test
+ void givenAStream_whenCollectByEmptyToNullCollector_shouldReturnExpectedResults() {
+ Collector, ArrayList> emptyListToNullCollector = Collector.of(ArrayList::new, ArrayList::add, (a, b) -> {
+ a.addAll(b);
+ return a;
+ }, a -> a.isEmpty() ? null : a);
+
+ List notNullResult = LANGUAGES.stream()
+ .filter(Objects::isNull)
+ .collect(emptyListToNullCollector);
+ assertNotNull(notNullResult);
+ assertEquals(Arrays.asList(null, null), notNullResult);
+
+ List nullResult = LANGUAGES.stream()
+ .filter(s -> s != null && s.length() == 1)
+ .collect(emptyListToNullCollector);
+ assertNull(nullResult);
+ }
+
+ @Test
+ void givenAStream_whenCollectByCollectingAndThen_shouldReturnExpectedResults() {
+ List notNullResult = LANGUAGES.stream()
+ .filter(Objects::nonNull)
+ .collect(collectingAndThen(toList(), Collections::unmodifiableList));
+ assertNotNull(notNullResult);
+ assertEquals(Arrays.asList("Kotlin", "Java", "Python", "Rust"), notNullResult);
+
+ //the result list becomes immutable
+ assertThrows(UnsupportedOperationException.class, () -> notNullResult.add("Oops"));
+
+ List nullResult = LANGUAGES.stream()
+ .filter(s -> s != null && s.length() == 1)
+ .collect(collectingAndThen(toList(), strings -> strings.isEmpty() ? null : strings));
+ assertNull(nullResult);
+ }
+}
\ No newline at end of file
diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml
index 59d30c1600..ac8b3115b5 100644
--- a/core-java-modules/pom.xml
+++ b/core-java-modules/pom.xml
@@ -121,6 +121,7 @@
core-java-streams-2
core-java-streams-3
core-java-streams-maps
+ core-java-streams-collect
core-java-string-algorithms
core-java-string-algorithms-2
core-java-string-apis