diff --git a/core-java-modules/core-java-collections-list/README.md b/core-java-modules/core-java-collections-list/README.md
new file mode 100644
index 0000000000..ff7a9876a2
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/README.md
@@ -0,0 +1,15 @@
+## Core Java Collections List
+
+This module contains articles about the Java List collection
+
+### Relevant Articles:
+- [Java – Get Random Item/Element From a List](http://www.baeldung.com/java-random-list-element)
+- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list)
+- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list)
+- [How to TDD a List Implementation in Java](http://www.baeldung.com/java-test-driven-list)
+- [Iterating Backward Through a List](http://www.baeldung.com/java-list-iterate-backwards)
+- [Remove the First Element from a List](http://www.baeldung.com/java-remove-first-element-from-list)
+- [How to Find an Element in a List with Java](http://www.baeldung.com/find-list-element-java)
+- [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max)
+- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list)
+- [[Next -->]](/core-java-modules/core-java-collections-list-2)
diff --git a/core-java-modules/core-java-collections-list/pom.xml b/core-java-modules/core-java-collections-list/pom.xml
new file mode 100644
index 0000000000..d62275ab6d
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/pom.xml
@@ -0,0 +1,31 @@
+
+
+ 4.0.0
+ core-java-collections-list
+ 0.1.0-SNAPSHOT
+ core-java-collections-list
+ jar
+
+
+ com.ossez.core-java-modules
+ core-java-modules
+ 0.0.2-SNAPSHOT
+
+
+
+
+
+ org.apache.commons
+ commons-collections4
+ ${commons-collections4.version}
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons-lang3.version}
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/findanelement/Customer.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/findanelement/Customer.java
new file mode 100644
index 0000000000..6807a6642b
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/findanelement/Customer.java
@@ -0,0 +1,37 @@
+package com.baeldung.findanelement;
+
+public class Customer {
+
+ private int id;
+ private String name;
+
+ public Customer(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ return id * 20;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Customer) {
+ Customer otherCustomer = (Customer) obj;
+ if (id == otherCustomer.id)
+ return true;
+ }
+ return false;
+ }
+
+
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/findanelement/FindACustomerInGivenList.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/findanelement/FindACustomerInGivenList.java
new file mode 100644
index 0000000000..b2d4250f6b
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/findanelement/FindACustomerInGivenList.java
@@ -0,0 +1,77 @@
+package com.baeldung.findanelement;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.collections4.IterableUtils;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
+public class FindACustomerInGivenList {
+
+ public Customer findUsingGivenIndex(int indexOfCustomer, List customers) {
+ if (indexOfCustomer >= 0 && indexOfCustomer < customers.size())
+ return customers.get(indexOfCustomer);
+ return null;
+ }
+
+ public int findUsingIndexOf(Customer customer, List customers) {
+ return customers.indexOf(customer);
+ }
+
+ public boolean findUsingContains(Customer customer, List customers) {
+ return customers.contains(customer);
+ }
+
+ public Customer findUsingIterator(String name, List customers) {
+ Iterator iterator = customers.iterator();
+ while (iterator.hasNext()) {
+ Customer customer = iterator.next();
+ if (customer.getName().equals(name)) {
+ return customer;
+ }
+ }
+ return null;
+ }
+
+ public Customer findUsingEnhancedForLoop(String name, List customers) {
+ for (Customer customer : customers) {
+ if (customer.getName().equals(name)) {
+ return customer;
+ }
+ }
+ return null;
+ }
+
+ public Customer findUsingStream(String name, List customers) {
+ return customers.stream()
+ .filter(customer -> customer.getName().equals(name))
+ .findFirst()
+ .orElse(null);
+ }
+
+ public Customer findUsingParallelStream(String name, List customers) {
+ return customers.parallelStream()
+ .filter(customer -> customer.getName().equals(name))
+ .findAny()
+ .orElse(null);
+ }
+
+ public Customer findUsingGuava(String name, List customers) {
+ return Iterables.tryFind(customers, new Predicate() {
+ public boolean apply(Customer customer) {
+ return customer.getName().equals(name);
+ }
+ }).orNull();
+ }
+
+ public Customer findUsingApacheCommon(String name, List customers) {
+ return IterableUtils.find(customers, new org.apache.commons.collections4.Predicate() {
+ public boolean evaluate(Customer customer) {
+ return customer.getName().equals(name);
+ }
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java/list/CustomList.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java/list/CustomList.java
new file mode 100644
index 0000000000..8b91fca32f
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java/list/CustomList.java
@@ -0,0 +1,210 @@
+package com.baeldung.java.list;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+public class CustomList implements List {
+ private Object[] internal = {};
+
+ @Override
+ public boolean isEmpty() {
+ // the first cycle
+ // return true;
+
+ // the second cycle
+ // if (internal.length != 0) {
+ // return false;
+ // } else {
+ // return true;
+ // }
+
+ // refactoring
+ return internal.length == 0;
+ }
+
+ @Override
+ public int size() {
+ // the first cycle
+ // if (isEmpty()) {
+ // return 0;
+ // } else {
+ // return internal.length;
+ // }
+
+ // refactoring
+ return internal.length;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public E get(int index) {
+ // the first cycle
+ // return (E) internal[0];
+
+ // improvement
+ return (E) internal[index];
+ }
+
+ @Override
+ public boolean add(E element) {
+ // the first cycle
+ // internal = new Object[] { element };
+ // return true;
+
+ // the second cycle
+ Object[] temp = Arrays.copyOf(internal, internal.length + 1);
+ temp[internal.length] = element;
+ internal = temp;
+ return true;
+ }
+
+ @Override
+ public void add(int index, E element) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean addAll(Collection extends E> collection) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean addAll(int index, Collection extends E> collection) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public E remove(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean remove(Object object) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean removeAll(Collection> collection) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean retainAll(Collection> collection) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean contains(Object object) {
+ for (Object element : internal) {
+ if (object.equals(element)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean containsAll(Collection> collection) {
+ for (Object element : collection)
+ if (!contains(element)) {
+ return false;
+ }
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public E set(int index, E element) {
+ E oldElement = (E) internal[index];
+ internal[index] = element;
+ return oldElement;
+ }
+
+ @Override
+ public void clear() {
+ internal = new Object[0];
+ }
+
+ @Override
+ public int indexOf(Object object) {
+ for (int i = 0; i < internal.length; i++) {
+ if (object.equals(internal[i])) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ @Override
+ public int lastIndexOf(Object object) {
+ for (int i = internal.length - 1; i >= 0; i--) {
+ if (object.equals(internal[i])) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List subList(int fromIndex, int toIndex) {
+ Object[] temp = new Object[toIndex - fromIndex];
+ System.arraycopy(internal, fromIndex, temp, 0, temp.length);
+ return (List) Arrays.asList(temp);
+ }
+
+ @Override
+ public Object[] toArray() {
+ return Arrays.copyOf(internal, internal.length);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public T[] toArray(T[] array) {
+ if (array.length < internal.length) {
+ return (T[]) Arrays.copyOf(internal, internal.length, array.getClass());
+ }
+
+ System.arraycopy(internal, 0, array, 0, internal.length);
+ if (array.length > internal.length) {
+ array[internal.length] = null;
+ }
+ return array;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new CustomIterator();
+ }
+
+ @Override
+ public ListIterator listIterator() {
+ return null;
+ }
+
+ @Override
+ public ListIterator listIterator(int index) {
+ // ignored for brevity
+ return null;
+ }
+
+ private class CustomIterator implements Iterator {
+ int index;
+
+ @Override
+ public boolean hasNext() {
+ return index != internal.length;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public E next() {
+ E element = (E) CustomList.this.internal[index];
+ index++;
+ return element;
+ }
+ }
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java/list/ReverseIterator.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java/list/ReverseIterator.java
new file mode 100644
index 0000000000..42dd543ed4
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java/list/ReverseIterator.java
@@ -0,0 +1,80 @@
+package com.baeldung.java.list;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.ListIterator;
+
+import org.apache.commons.collections4.iterators.ReverseListIterator;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Provides methods for iterating backward over a list.
+ */
+public class ReverseIterator {
+
+ /**
+ * Iterate using the for loop.
+ *
+ * @param list the list
+ */
+ public void iterateUsingForLoop(final List list) {
+
+ for (int i = list.size(); i-- > 0; ) {
+ System.out.println(list.get(i));
+ }
+ }
+
+ /**
+ * Iterate using the Java {@link ListIterator}.
+ *
+ * @param list the list
+ */
+ public void iterateUsingListIterator(final List list) {
+
+ final ListIterator listIterator = list.listIterator(list.size());
+ while (listIterator.hasPrevious()) {
+ System.out.println(listIterator.previous());
+ }
+ }
+
+ /**
+ * Iterate using Java {@link Collections} API.
+ *
+ * @param list the list
+ */
+ public void iterateUsingCollections(final List list) {
+
+ Collections.reverse(list);
+ for (final String item : list) {
+ System.out.println(item);
+ }
+ }
+
+ /**
+ * Iterate using Apache Commons {@link ReverseListIterator}.
+ *
+ * @param list the list
+ */
+ public void iterateUsingApacheReverseListIterator(final List list) {
+
+ final ReverseListIterator listIterator = new ReverseListIterator(list);
+ while (listIterator.hasNext()) {
+ System.out.println(listIterator.next());
+ }
+ }
+
+ /**
+ * Iterate using Guava {@link Lists} API.
+ *
+ * @param list the list
+ */
+ public void iterateUsingGuava(final List list) {
+
+ final List reversedList = Lists.reverse(list);
+ for (final String item : reversedList) {
+ System.out.println(item);
+ }
+ }
+
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java_8_features/Car.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java_8_features/Car.java
new file mode 100644
index 0000000000..139475bc25
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java_8_features/Car.java
@@ -0,0 +1,31 @@
+package com.baeldung.java_8_features;
+
+public class Car {
+
+ private String model;
+ private int topSpeed;
+
+ public Car(String model, int topSpeed) {
+ super();
+ this.model = model;
+ this.topSpeed = topSpeed;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public int getTopSpeed() {
+ return topSpeed;
+ }
+
+ public void setTopSpeed(int topSpeed) {
+ this.topSpeed = topSpeed;
+ }
+
+
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java_8_features/Person.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java_8_features/Person.java
new file mode 100644
index 0000000000..83b5530ee8
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/java_8_features/Person.java
@@ -0,0 +1,27 @@
+package com.baeldung.java_8_features;
+
+public class Person {
+ private String name;
+ private Integer age;
+
+ public Person(String name, int age) {
+ this.name = name;
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/Flower.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/Flower.java
new file mode 100644
index 0000000000..29c6a78326
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/Flower.java
@@ -0,0 +1,28 @@
+package com.baeldung.list;
+
+public class Flower {
+
+ private String name;
+ private int petals;
+
+ public Flower(String name, int petals) {
+ this.name = name;
+ this.petals = petals;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getPetals() {
+ return petals;
+ }
+
+ public void setPetals(int petals) {
+ this.petals = petals;
+ }
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Pen.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Pen.java
new file mode 100644
index 0000000000..efbd88d0b1
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Pen.java
@@ -0,0 +1,18 @@
+package com.baeldung.list.listoflist;
+
+public class Pen implements Stationery {
+
+ public String name;
+
+ public Pen(String name) {
+ this.name = name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+}
\ No newline at end of file
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Pencil.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Pencil.java
new file mode 100644
index 0000000000..7dfa119703
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Pencil.java
@@ -0,0 +1,18 @@
+package com.baeldung.list.listoflist;
+
+public class Pencil implements Stationery{
+
+ public String name;
+
+ public Pencil(String name) {
+ this.name = name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+}
\ No newline at end of file
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Rubber.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Rubber.java
new file mode 100644
index 0000000000..7511139e14
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Rubber.java
@@ -0,0 +1,18 @@
+package com.baeldung.list.listoflist;
+
+public class Rubber implements Stationery {
+
+ public String name;
+
+ public Rubber(String name) {
+ this.name = name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+}
\ No newline at end of file
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Stationery.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Stationery.java
new file mode 100644
index 0000000000..d914397cb8
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/listoflist/Stationery.java
@@ -0,0 +1,5 @@
+package com.baeldung.list.listoflist;
+
+public interface Stationery {
+
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/removeall/RemoveAll.java b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/removeall/RemoveAll.java
new file mode 100644
index 0000000000..d5f9cf4b4e
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/java/com/baeldung/list/removeall/RemoveAll.java
@@ -0,0 +1,111 @@
+package com.baeldung.list.removeall;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class RemoveAll {
+
+ static void removeWithWhileLoopPrimitiveElement(List list, int element) {
+ while (list.contains(element)) {
+ list.remove(element);
+ }
+ }
+
+ static void removeWithWhileLoopNonPrimitiveElement(List list, Integer element) {
+ while (list.contains(element)) {
+ list.remove(element);
+ }
+ }
+
+ static void removeWithWhileLoopStoringFirstOccurrenceIndex(List list, Integer element) {
+ int index;
+ while ((index = list.indexOf(element)) >= 0) {
+ list.remove(index);
+ }
+ }
+
+ static void removeWithCallingRemoveUntilModifies(List list, Integer element) {
+ while (list.remove(element))
+ ;
+ }
+
+ static void removeWithStandardForLoopUsingIndex(List list, int element) {
+ for (int i = 0; i < list.size(); i++) {
+ if (Objects.equals(element, list.get(i))) {
+ list.remove(i);
+ }
+ }
+ }
+
+ static void removeWithForLoopDecrementOnRemove(List list, int element) {
+ for (int i = 0; i < list.size(); i++) {
+ if (Objects.equals(element, list.get(i))) {
+ list.remove(i);
+ i--;
+ }
+ }
+ }
+
+ static void removeWithForLoopIncrementIfRemains(List list, int element) {
+ for (int i = 0; i < list.size();) {
+ if (Objects.equals(element, list.get(i))) {
+ list.remove(i);
+ } else {
+ i++;
+ }
+ }
+ }
+
+ static void removeWithForEachLoop(List list, int element) {
+ for (Integer number : list) {
+ if (Objects.equals(number, element)) {
+ list.remove(number);
+ }
+ }
+ }
+
+ static void removeWithIterator(List list, int element) {
+ for (Iterator i = list.iterator(); i.hasNext();) {
+ Integer number = i.next();
+ if (Objects.equals(number, element)) {
+ i.remove();
+ }
+ }
+ }
+
+ static List removeWithCollectingAndReturningRemainingElements(List list, int element) {
+ List remainingElements = new ArrayList<>();
+ for (Integer number : list) {
+ if (!Objects.equals(number, element)) {
+ remainingElements.add(number);
+ }
+ }
+ return remainingElements;
+ }
+
+ static void removeWithCollectingRemainingElementsAndAddingToOriginalList(List list, int element) {
+ List remainingElements = new ArrayList<>();
+ for (Integer number : list) {
+ if (!Objects.equals(number, element)) {
+ remainingElements.add(number);
+ }
+ }
+
+ list.clear();
+ list.addAll(remainingElements);
+ }
+
+ static List removeWithStreamFilter(List list, Integer element) {
+ return list.stream()
+ .filter(e -> !Objects.equals(e, element))
+ .collect(Collectors.toList());
+ }
+
+ static void removeWithRemoveIf(List list, Integer element) {
+ list.removeIf(n -> Objects.equals(n, element));
+ }
+
+}
diff --git a/core-java-modules/core-java-collections-list/src/main/resources/logback.xml b/core-java-modules/core-java-collections-list/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java
new file mode 100644
index 0000000000..5ef08a9337
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java
@@ -0,0 +1,105 @@
+package com.baeldung.collections;
+
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.containsInRelativeOrder;
+import static org.hamcrest.Matchers.hasSize;
+import static org.junit.Assert.assertThat;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.PredicateUtils;
+import org.junit.Test;
+
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+
+public class JavaCollectionCleanupUnitTest {
+
+ // tests - removing nulls
+
+ @Test
+ public void givenListContainsNulls_whenRemovingNullsWithPlainJava_thenCorrect() {
+ final List list = Lists.newArrayList(null, 1, null);
+ while (list.remove(null))
+ ;
+
+ assertThat(list, hasSize(1));
+ }
+
+ @Test
+ public void givenListContainsNulls_whenRemovingNullsWithPlainJavaAlternative_thenCorrect() {
+ final List list = Lists.newArrayList(null, 1, null);
+ list.removeAll(Collections.singleton(null));
+
+ assertThat(list, hasSize(1));
+ }
+
+ @Test
+ public void givenListContainsNulls_whenRemovingNullsWithGuavaV1_thenCorrect() {
+ final List list = Lists.newArrayList(null, 1, null);
+ Iterables.removeIf(list, Predicates.isNull());
+
+ assertThat(list, hasSize(1));
+ }
+
+ @Test
+ public void givenListContainsNulls_whenRemovingNullsWithGuavaV2_thenCorrect() {
+ final List list = Lists.newArrayList(null, 1, null, 2, 3);
+ final List listWithoutNulls = Lists.newArrayList(Iterables.filter(list, Predicates.notNull()));
+
+ assertThat(listWithoutNulls, hasSize(3));
+ }
+
+ @Test
+ public void givenListContainsNulls_whenRemovingNullsWithCommonsCollections_thenCorrect() {
+ final List list = Lists.newArrayList(null, 1, 2, null, 3, null);
+ CollectionUtils.filter(list, PredicateUtils.notNullPredicate());
+
+ assertThat(list, hasSize(3));
+ }
+
+ // tests - remove duplicates
+
+ @Test
+ public void givenListContainsDuplicates_whenRemovingDuplicatesWithPlainJava_thenCorrect() {
+ final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0);
+ final List listWithoutDuplicates = new ArrayList<>(new HashSet<>(listWithDuplicates));
+
+ assertThat(listWithoutDuplicates, hasSize(5));
+ assertThat(listWithoutDuplicates, containsInAnyOrder(5, 0, 3, 1, 2));
+ }
+
+ @Test
+ public void givenListContainsDuplicates_whenRemovingDuplicatesPreservingOrderWithPlainJava_thenCorrect() {
+ final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0);
+ final List listWithoutDuplicates = new ArrayList<>(new LinkedHashSet<>(listWithDuplicates));
+
+ assertThat(listWithoutDuplicates, hasSize(5));
+ assertThat(listWithoutDuplicates, containsInRelativeOrder(5, 0, 3, 1, 2));
+ }
+
+ @Test
+ public void givenListContainsDuplicates_whenRemovingDuplicatesWithGuava_thenCorrect() {
+ final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0);
+ final List listWithoutDuplicates = Lists.newArrayList(Sets.newHashSet(listWithDuplicates));
+
+ assertThat(listWithoutDuplicates, hasSize(5));
+ assertThat(listWithoutDuplicates, containsInAnyOrder(5, 0, 3, 1, 2));
+ }
+
+ @Test
+ public void givenListContainsDuplicates_whenRemovingDuplicatesPreservingOrderWithGuava_thenCorrect() {
+ final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0);
+ final List listWithoutDuplicates = Lists.newArrayList(Sets.newLinkedHashSet(listWithDuplicates));
+
+ assertThat(listWithoutDuplicates, hasSize(5));
+ assertThat(listWithoutDuplicates, containsInRelativeOrder(5, 0, 3, 1, 2));
+ }
+}
diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/findanelement/FindACustomerInGivenListUnitTest.java b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/findanelement/FindACustomerInGivenListUnitTest.java
new file mode 100644
index 0000000000..3c96cf1392
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/findanelement/FindACustomerInGivenListUnitTest.java
@@ -0,0 +1,158 @@
+package com.baeldung.findanelement;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+public class FindACustomerInGivenListUnitTest {
+
+ private static List customers = new ArrayList<>();
+
+ static {
+ customers.add(new Customer(1, "Jack"));
+ customers.add(new Customer(2, "James"));
+ customers.add(new Customer(3, "Sam"));
+ }
+
+ private static FindACustomerInGivenList findACustomerInGivenList = new FindACustomerInGivenList();
+
+ @Test
+ public void givenAnIndex_whenFoundUsingGivenIndex_thenReturnCustomer() {
+ Customer customer = findACustomerInGivenList.findUsingGivenIndex(0, customers);
+
+ assertEquals(1, customer.getId());
+ }
+
+ @Test
+ public void givenAnIndex_whenNotFoundUsingGivenIndex_thenReturnNull() {
+ Customer customer = findACustomerInGivenList.findUsingGivenIndex(5, customers);
+
+ assertNull(customer);
+ }
+
+ @Test
+ public void givenACustomer_whenFoundUsingContains_thenReturnTrue() {
+ Customer james = new Customer(2, "James");
+ boolean isJamesPresent = findACustomerInGivenList.findUsingContains(james, customers);
+
+ assertEquals(true, isJamesPresent);
+ }
+
+ @Test
+ public void givenACustomer_whenNotFoundUsingContains_thenReturnFalse() {
+ Customer john = new Customer(5, "John");
+ boolean isJohnPresent = findACustomerInGivenList.findUsingContains(john, customers);
+
+ assertEquals(false, isJohnPresent);
+ }
+
+ @Test
+ public void givenACustomer_whenFoundUsingIndexOf_thenReturnItsIndex() {
+ Customer james = new Customer(2, "James");
+ int indexOfJames = findACustomerInGivenList.findUsingIndexOf(james, customers);
+
+ assertEquals(1, indexOfJames);
+ }
+
+ @Test
+ public void givenACustomer_whenNotFoundUsingIndexOf_thenReturnMinus1() {
+ Customer john = new Customer(5, "John");
+ int indexOfJohn = findACustomerInGivenList.findUsingIndexOf(john, customers);
+
+ assertEquals(-1, indexOfJohn);
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameFoundUsingIterator_thenReturnCustomer() {
+ Customer james = findACustomerInGivenList.findUsingIterator("James", customers);
+
+ assertEquals("James", james.getName());
+ assertEquals(2, james.getId());
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameNotFoundUsingIterator_thenReturnNull() {
+ Customer john = findACustomerInGivenList.findUsingIterator("John", customers);
+
+ assertNull(john);
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameFoundUsingEnhancedFor_thenReturnCustomer() {
+ Customer james = findACustomerInGivenList.findUsingEnhancedForLoop("James", customers);
+
+ assertEquals("James", james.getName());
+ assertEquals(2, james.getId());
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameNotFoundUsingEnhancedFor_thenReturnNull() {
+ Customer john = findACustomerInGivenList.findUsingEnhancedForLoop("John", customers);
+
+ assertNull(john);
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameFoundUsingStream_thenReturnCustomer() {
+ Customer james = findACustomerInGivenList.findUsingStream("James", customers);
+
+ assertEquals("James", james.getName());
+ assertEquals(2, james.getId());
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameNotFoundUsingStream_thenReturnNull() {
+ Customer john = findACustomerInGivenList.findUsingStream("John", customers);
+
+ assertNull(john);
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameFoundUsingParallelStream_thenReturnCustomer() {
+ Customer james = findACustomerInGivenList.findUsingParallelStream("James", customers);
+
+ assertEquals("James", james.getName());
+ assertEquals(2, james.getId());
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameNotFoundUsingParallelStream_thenReturnNull() {
+ Customer john = findACustomerInGivenList.findUsingParallelStream("John", customers);
+
+ assertNull(john);
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameFoundUsingApacheCommon_thenReturnCustomer() {
+ Customer james = findACustomerInGivenList.findUsingApacheCommon("James", customers);
+
+ assertEquals("James", james.getName());
+ assertEquals(2, james.getId());
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameNotFoundUsingApacheCommon_thenReturnNull() {
+ Customer john = findACustomerInGivenList.findUsingApacheCommon("John", customers);
+
+ assertNull(john);
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameFoundUsingGuava_thenReturnCustomer() {
+ Customer james = findACustomerInGivenList.findUsingGuava("James", customers);
+
+ assertEquals("James", james.getName());
+ assertEquals(2, james.getId());
+ }
+
+ @Test
+ public void givenName_whenCustomerWithNameNotFoundUsingGuava_thenReturnNull() {
+ Customer john = findACustomerInGivenList.findUsingGuava("John", customers);
+
+ assertNull(john);
+ }
+
+}
diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/java/list/CustomListUnitTest.java b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/java/list/CustomListUnitTest.java
new file mode 100644
index 0000000000..9ea42e88e8
--- /dev/null
+++ b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/java/list/CustomListUnitTest.java
@@ -0,0 +1,296 @@
+package com.baeldung.java.list;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Test;
+
+public class CustomListUnitTest {
+ @Test
+ public void givenEmptyList_whenIsEmpty_thenTrueIsReturned() {
+ List