public static byte parsePermFromString(String permString) {
        if (permString == null) {
            return Permission.DENY;
        }
        switch (permString.trim()) {
            case AclConstants.PUB:
                return Permission.PUB;
            case AclConstants.SUB:
                return Permission.SUB;
            case AclConstants.PUB_SUB:
            case AclConstants.SUB_PUB:
                return Permission.PUB | Permission.SUB;
            case AclConstants.DENY:
                return Permission.DENY;
            default:
                return Permission.DENY;
        }
    }
@Test
    public void fromStringGetPermissionTest() {
        byte perm = Permission.parsePermFromString("PUB");
        Assert.assertEquals(perm, Permission.PUB);

        perm = Permission.parsePermFromString("SUB");
        Assert.assertEquals(perm, Permission.SUB);

        perm = Permission.parsePermFromString("PUB|SUB");
        Assert.assertEquals(perm, Permission.PUB | Permission.SUB);

        perm = Permission.parsePermFromString("SUB|PUB");
        Assert.assertEquals(perm, Permission.PUB | Permission.SUB);

        perm = Permission.parsePermFromString("DENY");
        Assert.assertEquals(perm, Permission.DENY);

        perm = Permission.parsePermFromString("1");
        Assert.assertEquals(perm, Permission.DENY);

        perm = Permission.parsePermFromString(null);
        Assert.assertEquals(perm, Permission.DENY);

    }