### Question:
PermissionDefinitions { PermissionInfo[] retrievePermissions(String location) { List<PermissionInfo> permInfoList = new ArrayList<PermissionInfo>(); Iterator<Triple> ownerTriples = systemGraph.filter(new IRI(location), OSGI.owner, null); if (ownerTriples.hasNext()) { BlankNodeOrIRI user = (BlankNodeOrIRI) ownerTriples.next().getObject(); lookForPermissions(user, permInfoList); } if (permInfoList.isEmpty()) { return null; } return permInfoList.toArray(new PermissionInfo[permInfoList.size()]); } PermissionDefinitions(Graph systeGraph);   }### Answer:
@Test public void testAllowedBundle() { PermissionInfo[] permInfos = this.permissionDefinitions .retrievePermissions("file: List<PermissionInfo> permInfoList = Arrays.asList(permInfos); List<PermissionInfo> expectedPermInfos = Arrays.asList(allPermissions); Assert.assertTrue(permInfoList.containsAll(expectedPermInfos)); Assert.assertTrue(expectedPermInfos.containsAll(permInfoList)); }
@Test public void testUnknownBundle() { Assert.assertNotSame(allPermissions, this.permissionDefinitions .retrievePermissions("file: Assert.assertArrayEquals(nullPermission, this.permissionDefinitions .retrievePermissions("file: }