ICompilationUnit icunit = type.getCompilationUnit();
String source = icunit.getBuffer().getContents();
Document document = new Document(source);
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(icunit);
CompilationUnit cunit = (CompilationUnit) parser.createAST(null);
cunit.recordModifications();
AST ast = cunit.getAST();
TypeDeclaration typeDec = (TypeDeclaration) cunit.types().get(0);
List list = typeDec.superInterfaceTypes();
Name name = ast.newName(cName);
Type interfaceType = ast.newSimpleType(name);
list.add(interfaceType);
TextEdit edits = cunit.rewrite(document, icunit.getJavaProject()
.getOptions(true));
edits.apply(document);
String newSource = document.get();
icunit.getBuffer().setContents(newSource);
} catch (Exception e) {