JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. . JUnit 4 uses Java 5 features such as generics and annotations. If you need compatibility with previous Java versions, you should use the junit package (version 3) instead. . This package contains Javadoc API documentation of JUnit 4.