public void set(int index, E value) {
        assert value != null;
        Storage32 newStorage = storage.set(index, value);
        if (newStorage != storage) {
            storage = newStorage;
        }
    }
@Test
    public void testSetSparseToDense32() {
        // add some sparse entries
        for (int i = 0; i < ARRAY_STORAGE_32_MAX_SPARSE_SIZE / 2; ++i) {
            set(i * 2);
            verify();
        }

        // restore density
        for (int i = 0; i < ARRAY_STORAGE_32_MAX_SPARSE_SIZE / 2; ++i) {
            set(i * 2 + 1);
            verify();
        }

        // make sure we still can insert something
        for (int i = 0; i < ARRAY_STORAGE_32_MAX_SPARSE_SIZE * 5; ++i) {
            set(i);
            verify();
        }
    }