Similar Items: A Framework for Certified Self-Stabilization