Sometimes data structures should have certain relationships that can't be directly described in Java, but that are good to check as early as possible when code is edited. Classic examples are that an array is big enough or that enums in different modules have corresponding members.
BOOST provides a fine "static assert" facility in C++ that even provides half-decent errors when assertions fail; does anyone know how to build a compile-time assertion facility in Java?
Edit: I just saw a perfect example: this class from Eclipse has two constant arrays that are assumed to be the same length. If that were my code, I'd like the compiler to tell me if they have different lengths.