Refactoring of topology tests