### Question:
JavaClassBuilderImpl extends BaseBuilder implements JavaClassBuilder { @Override public void addAnnotation(String annotationName) { MarkerAnnotationExpr annotationExpr = new MarkerAnnotationExpr(); annotationExpr.setName(annotationName); declaration.addAnnotation(annotationExpr); importAnnotation(annotationName); } JavaClassBuilderImpl(String packageName, String name, String annotationsPackage); @Override String getName(); @Override void setJavaDoc(String comment); @Override void addPrivateField(String name, String type, String description); @Override void addFieldAnnotation(String name, String annotationName); @Override void addAnnotation(String annotationName); @Override void generateGettersAndSetters(); @Override void addImport(String packageName, String object); static final Logger LOGGER; }### Answer:
@Test public void testBasicClassWithAnnotation() throws IOException { Capture<CompilationUnit> compilationUnitCapture = Capture.newInstance(); sourceProject.addCompilationUnit( eq(PACKAGE_NAME), eq(CLASS_NAME), capture(compilationUnitCapture)); javaClassBuilder.addAnnotation("Annotation"); javaClassBuilder.addAnnotation("Deprecated"); replayAll(); javaClassBuilder.build(sourceProject); assertEquals( "package com.github.kklisura;\n" + "\n" + "import com.github.kklisura.annotations.Annotation;\n" + "\n" + "@Annotation\n" + "@Deprecated\n" + "public class ClassName {\n" + "}\n" + "", compilationUnitCapture.getValue().toString()); verifyAll(); }