Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanth0525 committed Sep 1, 2024
1 parent e12fc22 commit 53c385d
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,16 @@ public void testFindDuplicatesNoDuplicates() {
@Test
public void testFindDuplicatesEmptyList() {
List<Integer> input = Arrays.asList();
List<Integer> expected = Arrays.asList();
List<Integer> actual = ListUtils.findDuplicates(input);
assertEquals(expected, actual, "The list should be empty as the input list is empty.");
assertTrue(ListUtils.findDuplicates(input).isEmpty(), "The list should be empty as the input list is empty.");
}

@Test
public void testFindDuplicatesSingleElement() {
List<Integer> input = Arrays.asList(1);
List<Integer> expected = Arrays.asList();
List<Integer> actual = ListUtils.findDuplicates(input);
assertEquals(expected, actual, "The list should be empty as there is only one element.");
assertTrue(ListUtils.findDuplicates(input).isEmpty(), "The list should be empty as there is only one element.");
}


@Test
public void testFindDuplicatesMultipleDuplicates() {
List<Integer> input = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 4);
Expand Down

0 comments on commit 53c385d

Please sign in to comment.