ztest is a java 1.5+ classlibrary for writing structural junit tests. Specify, enforce and reuse an architecture for java based software. Works on java bytecode, no sourcecode changes. Export diagrams to graphml and layout them with yEd.
Structure Doctor is a little utility that goes through Java source code and finds possible structural flaws, such as too big methods, duplicate code, duplicate class hierarchies etc... Flaw reports are generated in HTML.