Bug 38892 ASTRewrite should support copying nodes more than once.
M1 Try is result currently in an exception: org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; Node used as more than one copy source at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at org.eclipse.jdt.internal.corext.Assert$AssertionFailedException.<init> (Assert.java:55) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:136) at org.eclipse.jdt.internal.corext.dom.ASTRewrite.createCopy (ASTRewrite.java:289)
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingTypeDeclTest.java
modifiedNode.setModifiers(0);
			rewrite.markAsModified(type, modifiedNode);				
		
			Name superClass= type.getSuperclass();
			assertTrue("Has super type", superClass != null);
			
			rewrite.markAsRemoved(superClass);
			List superInterfaces= type.superInterfaces();
			assertTrue("Has super interfaces", !superInterfaces.isEmpty());
			
			rewrite.markAsRemoved((ASTNode) superInterfaces.get(0));
			
			List members= type.bodyDeclarations();
			assertTrue("Has declarations", !members.isEmpty());
					
			rewrite.markAsRemoved((ASTNode) members.get(1));
			
			MethodDeclaration meth= findMethodDeclaration(type, "hee");
			rewrite.markAsRemoved(meth);
		}
		{ 
			TypeDeclaration type= findTypeDeclaration(astRoot, "F");
			
			
			TypeDeclaration modifiedNode= ast.newTypeDeclaration();
			modifiedNode.setInterface(true); 
			modifiedNode.setModifiers(Modifier.FINAL);
			rewrite.markAsModified(type, modifiedNode);					
			
			List superInterfaces= type.superInterfaces();