rewrite.markAsRemoved((ASTNode) thrownExceptions.get(0)); rewrite.markAsRemoved((ASTNode) thrownExceptions.get(2));
rewrite.markAsRemoved((ASTNode) thrownExceptions.get(0), null); rewrite.markAsRemoved((ASTNode) thrownExceptions.get(2), null);
	public void testListRemoves() throws Exception {		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public abstract class E {\n");		buf.append("    public E(int p1, int p2, int p3) {}\n");		buf.append("    public void gee(int p1, int p2, int p3) throws IllegalArgumentException {}\n");		buf.append("    public void hee(int p1, int p2, int p3) throws IllegalArgumentException {}\n");		buf.append("    public void iee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException {}\n");		buf.append("    public void jee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException {}\n");		buf.append("    public abstract void kee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException, SecurityException;\n");		buf.append("    public abstract void lee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException, SecurityException;\n");		buf.append("}\n");			ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);					CompilationUnit astRoot= createAST(cu);		NewASTRewrite rewrite= new NewASTRewrite(astRoot.getAST());		TypeDeclaration type= findTypeDeclaration(astRoot, "E");				{ // delete first param			MethodDeclaration methodDecl= findMethodDeclaration(type, "E");			List parameters= methodDecl.parameters();			assertTrue("must be 3 parameters", parameters.size() == 3);			rewrite.markAsRemoved((ASTNode) parameters.get(0));		}		{ // delete second param & remove exception & remove public			MethodDeclaration methodDecl= findMethodDeclaration(type, "gee");						// change flags			rewrite.markAsReplaced(methodDecl, MethodDeclaration.MODIFIERS_PROPERTY, new Integer(0), null);						List parameters= methodDecl.parameters();			assertTrue("must be 3 parameters", parameters.size() == 3);			rewrite.markAsRemoved((ASTNode) parameters.get(1));						List thrownExceptions= methodDecl.thrownExceptions();			assertTrue("must be 1 thrown exceptions", thrownExceptions.size() == 1);			rewrite.markAsRemoved((ASTNode) thrownExceptions.get(0));		}				{ // delete last param			MethodDeclaration methodDecl= findMethodDeclaration(type, "hee");			List parameters= methodDecl.parameters();			assertTrue("must be 3 parameters", parameters.size() == 3);			rewrite.markAsRemoved((ASTNode) parameters.get(2));			}						{ // delete first and second param & remove first exception			MethodDeclaration methodDecl= findMethodDeclaration(type, "iee");			List parameters= methodDecl.parameters();			assertTrue("must be 3 parameters", parameters.size() == 3);			rewrite.markAsRemoved((ASTNode) parameters.get(0));			rewrite.markAsRemoved((ASTNode) parameters.get(1));						List thrownExceptions= methodDecl.thrownExceptions();			assertTrue("must be 2 thrown exceptions", thrownExceptions.size() == 2);			rewrite.markAsRemoved((ASTNode) thrownExceptions.get(0));			}						{ // delete first and last param & remove second			MethodDeclaration methodDecl= findMethodDeclaration(type, "jee");			List parameters= methodDecl.parameters();			assertTrue("must be 3 parameters", parameters.size() == 3);			rewrite.markAsRemoved((ASTNode) parameters.get(0));			rewrite.markAsRemoved((ASTNode) parameters.get(2));						List thrownExceptions= methodDecl.thrownExceptions();			assertTrue("must be 2 thrown exceptions", thrownExceptions.size() == 2);			rewrite.markAsRemoved((ASTNode) thrownExceptions.get(1));					}		{ // delete second and last param & remove first exception			MethodDeclaration methodDecl= findMethodDeclaration(type, "kee");			List parameters= methodDecl.parameters();			assertTrue("must be 3 parameters", parameters.size() == 3);			rewrite.markAsRemoved((ASTNode) parameters.get(1));			rewrite.markAsRemoved((ASTNode) parameters.get(2));						List thrownExceptions= methodDecl.thrownExceptions();			assertTrue("must be 3 thrown exceptions", thrownExceptions.size() == 3);			rewrite.markAsRemoved((ASTNode) thrownExceptions.get(1));		}				{ // delete all params & remove first and last exception			MethodDeclaration methodDecl= findMethodDeclaration(type, "lee");			List parameters= methodDecl.parameters();			assertTrue("must be 3 parameters", parameters.size() == 3);			rewrite.markAsRemoved((ASTNode) parameters.get(0));			rewrite.markAsRemoved((ASTNode) parameters.get(1));			rewrite.markAsRemoved((ASTNode) parameters.get(2));						List thrownExceptions= methodDecl.thrownExceptions();			assertTrue("must be 3 thrown exceptions", thrownExceptions.size() == 3);			rewrite.markAsRemoved((ASTNode) thrownExceptions.get(0));			rewrite.markAsRemoved((ASTNode) thrownExceptions.get(2));						}						String preview= evaluateRewrite(cu, rewrite);				buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public abstract class E {\n");		buf.append("    public E(int p2, int p3) {}\n");		buf.append("    void gee(int p1, int p3) {}\n");		buf.append("    public void hee(int p1, int p2) throws IllegalArgumentException {}\n");		buf.append("    public void iee(int p3) throws IllegalAccessException {}\n");		buf.append("    public void jee(int p2) throws IllegalArgumentException {}\n");		buf.append("    public abstract void kee(int p1) throws IllegalArgumentException, SecurityException;\n");		buf.append("    public abstract void lee() throws IllegalAccessException;\n");		buf.append("}\n");						assertEqualString(preview, buf.toString());	}