File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed
src/test/java/com/thealgorithms/datastructures/bag Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff 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 <>();
You can’t perform that action at this time.
0 commit comments