### Question:
PermissionAdmin implements PermissionAdminMBean { public void setDefaultPermissions(String[] encodedPermissions) throws IOException { PermissionInfo[] permissions = toPermissionInfo(encodedPermissions); permAdmin.setDefaultPermissions(permissions); } PermissionAdmin(org.osgi.service.permissionadmin.PermissionAdmin permAdmin); String[] getPermissions(String location); String[] listDefaultPermissions(); String[] listLocations(); void setDefaultPermissions(String[] encodedPermissions); void setPermissions(String location, String[] encodedPermissions);  }### Answer:
@Test public void testSetDefaultPermissions() throws IOException { PermissionInfo info1 = new PermissionInfo("Admin", "test", "get"); PermissionInfo info2 = new PermissionInfo("Admin", "test2", "get"); PermissionInfo[] permInfos = new PermissionInfo[] { info1, info2 }; String[] encodedPermissions = new String[2]; int i = 0; for (PermissionInfo info : permInfos) { encodedPermissions[i++] = info.getEncoded(); } mbean.setDefaultPermissions(encodedPermissions); Mockito.verify(permAdmin).setDefaultPermissions(permInfos); }