public void deleteTenant(TenantName name) {
        if (name.equals(DEFAULT_TENANT))
            throw new IllegalArgumentException("Deleting 'default' tenant is not allowed");
        if ( ! tenants.containsKey(name))
            throw new IllegalArgumentException("Deleting '" + name + "' failed, tenant does not exist");

        log.log(Level.INFO, "Deleting tenant '" + name + "'");
        // Deletes the tenant tree from ZooKeeper (application and session status for the tenant)
        // and triggers Tenant.close().
        try (Lock lock = tenantLocks.lock(name)) {
            Path path = tenants.get(name).getPath();
            closeTenant(name);
            curator.delete(path);
        }
    }
@Test(expected = IllegalArgumentException.class)
    public void testDeletingDefaultTenant()  {
        try {
            assertZooKeeperTenantPathExists(TenantName.defaultName());
        } catch (Exception e) {
            fail("default tenant does not exist");
        }
        tenantRepository.deleteTenant(TenantName.defaultName());
    }