Package Visibility for Injected Fields

Package Visibility for Injected Fields

Package visibility for injected fields encapsulates way better than public accessors and makes unit testing more convenient at the same time. This video done with NetBeans 7.2 Java EE edition and Glassfish 3.1.2 demonstrates what can happen in worst case.

Video source: http://www.adam-bien.com/roller/abien/entry/inject_with_package_private_fields