class ZMSUtils {

    public static void addAssertion(Policy policy, String resource, String action, String role,
            AssertionEffect effect) {
        
        List<Assertion> assertions = policy.getAssertions();
        if (assertions == null) {
            assertions = new ArrayList<>();
            policy.setAssertions(assertions);
        }
        Assertion assertion = new Assertion()
                .setAction(action)
                .setResource(resource)
                .setRole(role);
        if (effect != AssertionEffect.ALLOW) {
            assertion.setEffect(effect);
        }
        assertions.add(assertion);
    }

}