Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
josdem committed Apr 7, 2024
1 parent 4231f61 commit a1d338a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
public class Differentiator {

public List<Integer> diff(List<Integer> a, List<Integer> b) {
return a;
return a.stream().filter(number -> !b.contains(number)).toList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DifferentiatorTest {
@DisplayName("Get difference")
void shouldGetDifferenceInArrays() {
assertEquals(List.of(2), differentiator.diff(List.of(1, 2), List.of(1)));
assertEquals(List.of(2, 2), differentiator.diff(List.of(1, 2), List.of(1)));
assertEquals(List.of(2, 2), differentiator.diff(List.of(1, 2, 2), List.of(1)));
assertEquals(List.of(1), differentiator.diff(List.of(1, 2, 2), List.of(2)));
assertEquals(List.of(1, 2, 2), differentiator.diff(List.of(1, 2, 2), new ArrayList<>()));
assertEquals(new ArrayList<>(), differentiator.diff(new ArrayList<>(), List.of(1, 2)));
Expand Down

0 comments on commit a1d338a

Please sign in to comment.