### Question:
XmlSeeAlsoAnnotator implements Annotator { public void annotate(JavaAnnotatable ja) { if (collector == null || collector.getTypesPackages().isEmpty()) { return; } JavaInterface intf = null; if (ja instanceof JavaInterface) { intf = (JavaInterface) ja; } else { throw new RuntimeException("XmlSeeAlso can only annotate JavaInterface"); } JAnnotation jaxbAnnotation = new JAnnotation(XmlSeeAlso.class); intf.addImports(jaxbAnnotation.getImports()); List<JavaType> types = new ArrayList<>(); for (String pkg : collector.getTypesPackages()) { if (pkg.equals(intf.getPackageName())) { types.add(new JavaType(null, "ObjectFactory", null)); } else { types.add(new JavaType(null, pkg + ".ObjectFactory", null)); } } jaxbAnnotation.addElement(new JAnnotationElement(null, types)); intf.addAnnotation(jaxbAnnotation); } XmlSeeAlsoAnnotator(ClassCollector c); void annotate(JavaAnnotatable  ja);  }### Answer:
@Test public void testAddXmlSeeAlsoAnnotation() throws Exception { JavaInterface intf = new JavaInterface(); assertFalse(intf.getImports().hasNext()); ClassCollector collector = new ClassCollector(); collector.getTypesPackages().add(ObjectFactory.class.getPackage().getName()); intf.annotate(new XmlSeeAlsoAnnotator(collector)); Iterator<String> iter = intf.getImports(); assertEquals("javax.xml.bind.annotation.XmlSeeAlso", iter.next()); assertEquals("@XmlSeeAlso({" + ObjectFactory.class.getName() + ".class})", intf.getAnnotations().iterator().next().toString()); }