Suppose I have a class ClasswithPrivateState which has a private field that depends strictly on the current system state when the object is created. Currently, this field is initialized inside the constructor.
But then I got stuck at testing this class since I can't change this private field in my testing method to test some cases. I am aware that I can use java reflection to change it, but I am wondering if this means the class design is bad or there is a better way to test it?