If we can use Guava, VisibleForAnnotation can be used here. https://guava-libraries.googlecode.com/svn/tags/release09/javadoc/com/google/common/annotations/VisibleForTesting.html