JUnit is a good framework designed to handle most of the scenarios that need to be tested when we implement any functionality in java. See this tutorial.
bhaskar wrote: "there is a need to pass the current class instance as an argument to a method of another object".
Not sure what you mean by method of another object. Objects don't have methods, classes do. Yes, a method runs on an instance of a class which points to the object. Please clarify what is it exactly that you are trying to say here.
Thank you for the reply.
The scenario is like i m testing a method in the application module..the method calls an another method in the service class and it passes the instances of the application module class.