ExceptionGenerator { public void generateConstructors(Classifier clazz, AST ast, TypeDeclaration td) { generateConstructorDefault(clazz, ast, td); generateConstructorWithParams(clazz, ast, td, new String[] { "Throwable" }, new String[] { "cause" }); generateConstructorWithParams(clazz, ast, td, new String[] { "String" }, new String[] { "message" }); generateConstructorWithParams(clazz, ast, td, new String[] { "String", "Throwable" }, new String[] { "message", "cause" }); }  void setCheckedException(boolean isCheckedException); CompilationUnit generateCheckedException(Classifier clazz,
			String sourceDirectoryPackageName); CompilationUnit generateUncheckedException(Classifier clazz,
			String sourceDirectoryPackageName); @SuppressWarnings("unchecked") void generateSerialVersionUID(Classifier clazz, AST ast,
			TypeDeclaration td); @SuppressWarnings("unchecked") TypeDeclaration generateClass(Classifier clazz, AST ast,
			CompilationUnit cu); void generateConstructors(Classifier clazz, AST ast,
			TypeDeclaration td); @SuppressWarnings("unchecked") void generateConstructorWithParams(Classifier clazz, AST ast,
			TypeDeclaration td, String[] varTypes, String[] varNames);  }
@Test public void testGenerateConstructors() { AST ast = AST.newAST(AST.JLS3); TypeDeclaration td = ast.newTypeDeclaration(); td.setName(ast.newSimpleName("CompanyException")); when(clazz.getName()).thenReturn("CompanyException"); exceptionGenerator.generateConstructors(clazz, ast, td); assertEquals( "class CompanyException {\n public CompanyException(){\n }\n" + " public CompanyException( Throwable cause){\n" + " super(cause);\n }\n public CompanyException( String message){\n" + " super(message);\n }\n" + " public CompanyException( String message, Throwable cause){\n" + " super(message,cause);\n }\n" + "}\n", td.toString()); }