Are you asking about creating a test program with something like
JUnit?
There are lots of ways to test your classes.
JUnit is used for something called
unit testing.
Generally unit tests are in a different path than the program being tested, but still in the same package. That might seem confusing without an example. So say I have a program in
workspace/MyApp/src/main/java/net/snortum/myapp/MyClass.java
"workspace/MyApp" is your project directory. "src/main/java" is one convention for ordering
Java files. "net/snortum/myapp" is the package and MyClass.java is the program to test. Your testing program might go in
workspace/MyApp/src/test/java/net/snortum/myapp/MyClassTest.java
Notice that it is in a different path, but in the same package.