  Resonances in optical cavities have been used to manipulate light
propagation, enhance light-matter interaction, modulate quantum states, and so
on. However, in traditional cavities, the permittivity contrast in and out the
cavity is not so high. Recently, zero-index materials (ZIMs) with unique
properties and specific applications have attracted great interest. By putting
optical cavity into ZIMs, the extreme circumstance with infinite permittivity
contrast can be obtained. Here, we theoretically study Mie resonances of
dielectric cavities embedded in ZIMs with $\varepsilon \approx 0$, or $\mu
\approx 0$, or $(\varepsilon,\mu) \approx 0$. Owing to ultrahigh contrast ratio
of $\varepsilon$ or $\mu$ in and out the cavities, with fixed wavelength, a
series of Mie resonances with the same angular mode number $l$ but with
different cavity radii are obtained; more interestingly, its $2^l$-TM (TE) and
$2^{l+1}$-TE (TM) modes have the same resonant solution for the cavity in
$\varepsilon \approx 0$ ($\mu \approx 0$) material, and the resonance
degeneracy also occurs between $2^l$-TM mode and $2^l$-TE mode for
$(\varepsilon,\mu) \approx 0$ material. We further use resonance degeneracy to
modulate the Purcell effect of quantum emitter inside the cavity. The results
of resonance nesting and degeneracy will provide an additional view or freedom
to enhance the performance of cavity behaviors.
