### Question:
PermissionManager { public GroupsPermissions<GeneralPermission> getPermissionsMapFor(Component component) { return getPermissionsMapFor(GeneralPermission.getAllAsList(), component); } PermissionManager(@Nonnull AclManager aclManager, @Nonnull GroupDao groupDao,
                             @Nonnull AclUtil aclUtil); void changeGrants(Entity entity, PermissionChanges changes); void changeRestrictions(Entity entity, PermissionChanges changes); GroupsPermissions<GeneralPermission> getPermissionsMapFor(Component component); GroupsPermissions<ProfilePermission> getPermissionsMapFor(List<Group> groups); GroupsPermissions<T> getPermissionsMapFor(List<T> permissions, Entity entity);  }### Answer:
@Test public void testGetPermissionsMapForComponent() throws Exception { Component component = TestFixtures.randomComponentWithId(); givenPermissions(component, GeneralPermission.values()); GroupsPermissions<GeneralPermission> groupsPermissions = manager.getPermissionsMapFor(component); verify(aclManager).getGroupPermissionsOn(eq(component)); assertTrue(groupsPermissions.getPermissions().containsAll(permissions)); for (GroupAce groupAce : groupAces) { List<Group> groups = groupsPermissions.get(GeneralPermission.findByMask(groupAce.getPermissionMask()), groupAce.isGranting()); assertNotNull(getGroupWithId(groups, groupAce.getGroupId())); } }