I'm not sure I understand that part, but yes, your implementation looks fine to me. See also Dropping Comparable requirement for indices.
FWIW, to this day, I still turn this design choice choice over in my head wondering if we got it right.
Note also that you could invalidate fewer indices by counting down instead of up
2 Likes