Skip to content

Commit ae5192b

Browse files
committed
testing: redundant test
1 parent 1e1649f commit ae5192b

File tree

1 file changed

+0
-18
lines changed
  • src/test/java/com/thealgorithms/datastructures/bag

1 file changed

+0
-18
lines changed

src/test/java/com/thealgorithms/datastructures/bag/BagTest.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,6 @@ void testIteratorWithDuplicates() {
160160
assertEquals(3, count, "Iterator should traverse all 3 items including duplicates");
161161
}
162162

163-
@Test
164-
void testAddNullElement() {
165-
Bag<String> bag = new Bag<>();
166-
bag.add(null);
167-
bag.add("item1");
168-
bag.add(null); // Add null twice
169-
170-
assertEquals(3, bag.size(), "Bag should contain 3 elements including nulls");
171-
assertTrue(bag.contains(null), "Bag should contain null");
172-
assertTrue(bag.contains("item1"), "Bag should contain 'item1'");
173-
174-
int nullCount = 0;
175-
for (String item : bag) {
176-
if (item == null) nullCount++;
177-
}
178-
assertEquals(2, nullCount, "Bag should contain exactly 2 null values");
179-
}
180-
181163
@Test
182164
void testCollectionElements() {
183165
Bag<List<String>> bag = new Bag<>();

0 commit comments

Comments
 (0)