if (!(policyTO instanceof AccountPolicyTO)) {
throw new ClassCastException("Expected " + AccountPolicyTO.class.getName()
+ ", found " + policyTO.getClass().getName());
}
if (policy == null) {
policy = (T) new AccountPolicy(isGlobal);
}
policy.setSpecification(((AccountPolicyTO) policyTO).getSpecification());
((AccountPolicy) policy).getResources().clear();
for (String resourceName : ((AccountPolicyTO) policyTO).getResources()) {