public static List<Permission> getAdminApplicationPermissions(
            Set<org.onosproject.security.Permission> permissions) {
        List<Permission> perms = Lists.newArrayList();
        perms.addAll(defaultPermissions);
        perms.addAll(adminServicePermissions);
        for (AppPermission.Type perm : serviceDirectory.keySet()) {
            perms.add(new AppPermission(perm));
        }
        perms.addAll(convertToJavaPermissions(permissions));
        return optimizePermissions(perms);
    }
@Test
    public void testGetAdminApplicationPermissions() {
        List<Permission> perms = Lists.newArrayList();
        perms.addAll(defaultPermissions);
        perms.addAll(adminServicePermissions);
        perms.addAll(testJavaPerms);
        assertEquals(7, perms.size());
        assertTrue(perms.contains(testJavaPerm));
    }