private static Stream<AclBinding> aclBindings(DescribeAclsResource resource) {
        return resource.acls().stream().map(acl -> {
            ResourcePattern pattern = new ResourcePattern(
                    ResourceType.fromCode(resource.resourceType()),
                    resource.resourceName(),
                    PatternType.fromCode(resource.patternType()));
            AccessControlEntry entry = new AccessControlEntry(
                    acl.principal(),
                    acl.host(),
                    AclOperation.fromCode(acl.operation()),
                    AclPermissionType.fromCode(acl.permissionType()));
            return new AclBinding(pattern, entry);
        });
    }
@Test
    public void testAclBindings() {
        final AclBinding original = new AclBinding(new ResourcePattern(ResourceType.TOPIC, "foo", PatternType.LITERAL),
                new AccessControlEntry("User:ANONYMOUS", "127.0.0.1", AclOperation.CREATE, AclPermissionType.ALLOW));

        final List<AclBinding> result = DescribeAclsResponse.aclBindings(Collections.singletonList(LITERAL_ACL1));
        assertEquals(1, result.size());
        assertEquals(original, result.get(0));
    }