public static void checkResourcePerms(List<String> resources) {
        if (resources == null || resources.isEmpty()) {
            return;
        }

        for (String resource : resources) {
            String[] items = StringUtils.split(resource, "=");
            if (items.length != 2) {
                throw new AclException(String.format("Parse Resource format error for %s.\n" +
                    "The expected resource format is 'Res=Perm'. For example: topicA=SUB", resource));
            }

            if (!AclConstants.DENY.equals(items[1].trim()) && Permission.DENY == Permission.parsePermFromString(items[1].trim())) {
                throw new AclException(String.format("Parse resource permission error for %s.\n" +
                    "The expected permissions are 'SUB' or 'PUB' or 'SUB|PUB' or 'PUB|SUB'.", resource));
            }
        }
    }
@Test
    public void checkResourcePermsNormalTest() {
        Permission.checkResourcePerms(null);
        Permission.checkResourcePerms(new ArrayList<>());
        Permission.checkResourcePerms(Arrays.asList("topicA=PUB"));
        Permission.checkResourcePerms(Arrays.asList("topicA=PUB", "topicB=SUB", "topicC=PUB|SUB"));
    }