Interface extends InnerInterface implements CompilationUnit { @Override public void addImportedType(FullyQualifiedJavaType importedType) { if (importedType.isExplicitlyImported() && !importedType.getPackageName().equals(getType().getPackageName())) { importedTypes.add(importedType); } } 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 testAddImportedType() { Interface interfaze = new Interface("com.foo.UserInterface"); FullyQualifiedJavaType arrayList = FullyQualifiedJavaType.getNewArrayListInstance(); interfaze.addImportedType(arrayList); assertNotNull(interfaze.getImportedTypes()); assertEquals(1, interfaze.getImportedTypes().size()); assertTrue(interfaze.getImportedTypes().contains(arrayList)); }