final ModelNode remove = Util.createRemoveOperation(parentAddress.append(PathElement.pathElement(resourceType, childName)));
ModelTestUtils.checkOutcome(mainServices.executeOperation(remove));
ModelTestUtils.checkOutcome(mainServices.executeOperation(modelVersion, mainServices.transformOperation(modelVersion, remove)));
if (--i > 0) {
//There are still xxx-module so we work fine
legacyServices.executeForResult(Util.createOperation(ReadResourceHandler.DEFINITION, parentAddress));
attributes = getLegacyAttribute(legacyServices, parentAddress, attributeName);
Assert.assertEquals(i, attributes.size());
} else {
//Here the read-resource should fail since the resource no longer exists, removal of
//the last xxx-module resource becomes a remove of the parent