@SuppressWarnings("deprecation")
    public static List<SimpleAclRule> fromCrd(AclRule rule) {
        if (rule.getOperations() != null && rule.getOperation() != null) {
            throw new InvalidResourceException("Both fields `operations` and `operation` cannot be filled in at the same time");
        } else if (rule.getOperations() != null) {
            List<SimpleAclRule> simpleAclRules = new ArrayList<>();
            for (AclOperation operation : rule.getOperations()) {
                simpleAclRules.add(new SimpleAclRule(rule.getType(), SimpleAclRuleResource.fromCrd(rule.getResource()), rule.getHost(), operation));
            }
            return simpleAclRules;
        } else {
            return List.of(new SimpleAclRule(rule.getType(), SimpleAclRuleResource.fromCrd(rule.getResource()), rule.getHost(), rule.getOperation()));
        }
    }
@Test
    public void testFromCrd()   {
        AclRule rule = new AclRuleBuilder()
            .withType(AclRuleType.ALLOW)
            .withResource(ACL_RULE_TOPIC_RESOURCE)
            .withHost("127.0.0.1")
            .withOperation(AclOperation.READ)
            .build();

        List<SimpleAclRule> simpleAclRules = SimpleAclRule.fromCrd(rule);
        assertThat(simpleAclRules.get(0).getOperation(), is(AclOperation.READ));
        assertThat(simpleAclRules.get(0).getType(), is(AclRuleType.ALLOW));
        assertThat(simpleAclRules.get(0).getHost(), is("127.0.0.1"));
        assertThat(simpleAclRules.get(0).getResource(), is(RESOURCE));
    }