Suppose you're writing an interface that's suppose to be your public API, let's call it Session. It's implementation is called SessionImpl and it's going to be injected by your DI framework.
I'm stuck thinking about the class access for this SessionImpl class, whether it should be restricted to it's package (since the public API is the interface) but not being able to test it from a different test project, or just make it public and test it.
The third option would be testing it through it's interface by making the DI use a factory, and calling the factory from the test.
What's the correct approach to maintain a simple maintainable code?