I remeber having gone through a
java tip that recommends writing
test class as a static inner class inside the source file that we are testing.
The biggest advantage is that we have access to the outer class's private variables inside the test methods. That makes it easier to assert.
Had the test been outside the class , in extreme cases, i might have to change the access modifier of certain variables just to make sure that the test goes through fine. I guess that is not advisable.
What do u guys recommend?