I think the answer is no, not at the package level. I tend to cheat and define my internal objects for testing purposes as protected . This works with at least "unused" warnings:
protected static class TestFoo { ... }
As @ user47900 noted, you can use the SuppressWarnings annotation to get around a single warning, but they usually need to be defined for each class and cannot cover all inner classes and packages.
@SuppressWarnings("unused") private static class TestFoo { ... }
source share