@Test
void link() {

    PolicyBackedServiceLinker policyBackedServiceLinker = new PolicyBackedServiceLinker();
    Map<String, String> operations = new HashMap<>();
    operations.put("operation1", "1");
    operations.put("operation2", "2");
    PolicyBackedService myPolicyBackedService = createPolicyBackedService("myEncass", "1", "PolicyBackedService", operations);
    Bundle bundle = new Bundle();
    bundle.addEntity(myPolicyBackedService);
    Bundle fullBundle = new Bundle();
    fullBundle.addEntity(myPolicyBackedService);
    fullBundle.addEntity(createPolicy("operation1Policy", "1", "1", "1", null, ""));
    fullBundle.addEntity(createPolicy("operation2Policy", "2", "2", "1", null, ""));
    fullBundle.addEntity(createFolder("myFolder", "1", null));
    FolderTree folderTree = new FolderTree(fullBundle.getEntities(Folder.class).values());
    fullBundle.setFolderTree(folderTree);
    policyBackedServiceLinker.link(bundle, fullBundle);
    assertEquals("operation1Policy", bundle.getEntities(PolicyBackedService.class).get("1").getOperations().stream().collect(Collectors.toMap(PolicyBackedServiceOperation::getOperationName, PolicyBackedServiceOperation::getPolicy)).get("operation1"));
    assertEquals("operation2Policy", bundle.getEntities(PolicyBackedService.class).get("1").getOperations().stream().collect(Collectors.toMap(PolicyBackedServiceOperation::getOperationName, PolicyBackedServiceOperation::getPolicy)).get("operation2"));
}