GrExtendsClause () { final GrTypeDefinition typeDefinition = createTypeDefinition("class A extends B {}"); final GrExtendsClause clause = typeDefinition.getExtendsClause(); clause.getReferenceElementsGroovy()[0].delete(); return clause; }