@Override
    @SuppressWarnings("unchecked")
    public synchronized boolean addAll(Collection<? extends E> c) {
        if (c instanceof BitList) {
            rootSet.or(((BitList<? extends E>) c).rootSet);
            if (((BitList<? extends E>) c).hasMoreElementInTailList()) {
                for (E e : ((BitList<? extends E>) c).tailList) {
                    addToTailList(e);
                }
            }
            return true;
        }
        return super.addAll(c);
    }
@Test
    void testAddAll() {
        List<String> list = Arrays.asList("A", "B", "C");
        BitList<String> bitList1 = new BitList<>(list);
        BitList<String> bitList2 = new BitList<>(list);

        bitList1.removeAll(list);
        Assertions.assertEquals(0, bitList1.size());

        bitList1.addAll(bitList2);

        Assertions.assertEquals(3, bitList1.size());
        Assertions.assertFalse(bitList1.hasMoreElementInTailList());

        bitList1.addAll(bitList2);

        Assertions.assertEquals(3, bitList1.size());
    }