Adding to what ChampionAsh5357 said,
You need to use the supplier method which looks like this:
.effect(Supplier<EffectInstance> effectIn, float probability)
You can take your deprecated code and modify it easily by adding a lambda and passing no parameters:
.effect(() -> new EffectInstance(Effects.REGENERATION,200,1),1)
.effect(() -> new EffectInstance(Effects.HEALTH_BOOST, 300, 1), 0.2f)