Interface extends InnerInterface implements CompilationUnit { @Override public void addImportedTypes(Set<FullyQualifiedJavaType> importedTypes) { this.importedTypes.addAll(importedTypes); } Interface(FullyQualifiedJavaType type);  Interface(String type); @Override Set<FullyQualifiedJavaType> getImportedTypes(); @Override void addImportedType(FullyQualifiedJavaType importedType); @Override void addFileCommentLine(String commentLine); @Override List<String> getFileCommentLines(); @Override void addImportedTypes(Set<FullyQualifiedJavaType> importedTypes); @Override Set<String> getStaticImports(); @Override void addStaticImport(String staticImport); @Override void addStaticImports(Set<String> staticImports); @Override R accept(CompilationUnitVisitor<R> visitor);  }
@Test public void testAddImportedTypes() { Interface interfaze = new Interface("com.foo.UserInterface"); Set<FullyQualifiedJavaType> importedTypes = new HashSet<>(); FullyQualifiedJavaType arrayList = FullyQualifiedJavaType.getNewArrayListInstance(); FullyQualifiedJavaType hashMap = FullyQualifiedJavaType.getNewHashMapInstance(); importedTypes.add(arrayList); importedTypes.add(hashMap); interfaze.addImportedTypes(importedTypes); assertNotNull(interfaze.getImportedTypes()); assertEquals(2, interfaze.getImportedTypes().size()); assertTrue(interfaze.getImportedTypes().contains(arrayList)); assertTrue(interfaze.getImportedTypes().contains(hashMap)); }