Writing/implementing an API: testability vs information hiding
问题 Many times I am involved in the design/implementation of APIs I am facing this dilemma. I am a very strong supporter of information hiding and try to use various techniques for that, including but not limited to inner classes, private methods, package-private qualifiers, etc. The problem with these techniques is that they tend to prevent good testability. And while some of these techniques can be resolved (e.g. package-privateness by putting a class into the same package), others are not so