JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
JavaResource root = java.getTestJavaResource(java.getBasePackage() + ".Root");
if (!root.exists())
{
java.saveTestJavaSource(JavaParser.create(JavaInterface.class).setName("Root")
.setPackage(java.getBasePackage()));
}
clazz.addImport(root.getJavaSource());
clazz.addImport(WebArchive.class);