[SD-1003] Role cannot inherit itself as its ancestor

I would like to have built a more complex test for the inheritance, something like create Role A, create Role B that extends Role A Then try to make Role A extend role B, Amy ideas how to do this? 
These two if clauses can be merged.