diff --git a/javaslang/src/main/java/javaslang/collection/List.java b/javaslang/src/main/java/javaslang/collection/List.java index dc22c7ca53..ce5b37a18a 100644 --- a/javaslang/src/main/java/javaslang/collection/List.java +++ b/javaslang/src/main/java/javaslang/collection/List.java @@ -1039,7 +1039,7 @@ default List remove(T element) { boolean found = false; while (!found && !result.isEmpty()) { final T head = result.head(); - if (head.equals(element)) { + if (Objects.equals(head, element)) { found = true; } else { preceding.addFirst(head);