From 1c04441b035b90604ccaa0475d2ba8a372c99005 Mon Sep 17 00:00:00 2001 From: Alessio Stalla Date: Fri, 8 Nov 2019 10:04:51 +0100 Subject: [PATCH] #BAEL-18411 change code sample to use equals instead of equalsIgnoreCase and add commented out break statement mentioned in the article. --- .../collection/filtering/CollectionFilteringUnitTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java b/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java index cbc7136192..d41c12cd23 100644 --- a/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java +++ b/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java @@ -33,9 +33,9 @@ public class CollectionFilteringUnitTest { for (Employee employee : originalList) { for (String name : nameFilter) { - if (employee.getName() - .equalsIgnoreCase(name)) { + if (employee.getName().equals(name)) { filteredList.add(employee); + //break; } } }