What are type annotations good for?
Type annotations make Java’s annotation system more expressive and uniform. Thus, they can be used for many of the same purposes as Java 5’s declaration annotations. A new use is as type qualifiers. Programmers can write these type qualifiers in their programs, and then a compiler plug-in automatically finds bugs. No tool will solve all your problems, but pluggable type-checkers have been shown to help programmers to rid their programs of certain important classes of bugs, including null pointer errors, incorrect side effects, incorrect equality tests, and more. Users of the Checker Framework keep noticing new ways that pluggable type-checkers are useful, and you probably will too. For more details, see the Checker Framework Manual and also section Example use of type annotations: Type qualifiers in the Type Annotations Specification.