Having data-driven code to check if a value is in bounds, and sometimes wanting the bounds to be open on either or both sides.
Also: creating an efficient sort key.