Test it for what?
Javac tests your java code to see if can be compiled.

Do you mean static code analysis?
Static program analysis - Wikipedia, the free encyclopedia
List of tools for static...