public boolean hasReadPermissionForWholeCollection(final Subject subject,
                                                       final String collection) {
        return readPermissionForCollection(collection)
                .map(rp -> rp.equals(DbEntity.ALL_ALLOWED) || subject.isPermitted(rp + ":*"))
                .orElse(false);
    }
@Test
    void hasReadPermissionForWholeCollectionReturnsTrueWhenSubjectHasPermission() {
        doReturn(Optional.of(
                new DbEntityCatalogEntry("streams", "title", StreamImpl.class, "streams:read"))
        ).when(catalog)
                .getByCollectionName("streams");

        doReturn(true).when(subject).isPermitted("streams:read:*");
        final boolean hasReadPermissions = toTest.hasReadPermissionForWholeCollection(subject, "streams");
        assertTrue(hasReadPermissions);
    }