@Test void testGetPermissionSets() { Map<PermissionSet, Set<Permission>> expected = ImmutableMap.of( WRITEMETA, ImmutableSet.of(TestPermission.READ, TestPermission.UPDATE, TestPermission.DELETE), WRITE, ImmutableSet.of(TestPermission.READ, TestPermission.UPDATE, TestPermission.DELETE), READ, ImmutableSet.of(TestPermission.READ)); assertEquals(expected, permissionRegistry.getPermissionSets()); }
public Map<PermissionSet, Set<Permission>> getPermissionSets() { return mapping.entries().stream() .collect(groupingBy(Entry::getValue, LinkedHashMap::new, mapping(Entry::getKey, toSet()))); }
PermissionRegistry { public Map<PermissionSet, Set<Permission>> getPermissionSets() { return mapping.entries().stream() .collect(groupingBy(Entry::getValue, LinkedHashMap::new, mapping(Entry::getKey, toSet()))); } }
PermissionRegistry { public Map<PermissionSet, Set<Permission>> getPermissionSets() { return mapping.entries().stream() .collect(groupingBy(Entry::getValue, LinkedHashMap::new, mapping(Entry::getKey, toSet()))); }  }
PermissionRegistry { public Map<PermissionSet, Set<Permission>> getPermissionSets() { return mapping.entries().stream() .collect(groupingBy(Entry::getValue, LinkedHashMap::new, mapping(Entry::getKey, toSet()))); }  void addMapping(Permission permission, PermissionSet... permissionSet); Set<PermissionSet> getPermissions(Permission permission); Map<PermissionSet, Set<Permission>> getPermissionSets(); }
PermissionRegistry { public Map<PermissionSet, Set<Permission>> getPermissionSets() { return mapping.entries().stream() .collect(groupingBy(Entry::getValue, LinkedHashMap::new, mapping(Entry::getKey, toSet()))); }  void addMapping(Permission permission, PermissionSet... permissionSet); Set<PermissionSet> getPermissions(Permission permission); Map<PermissionSet, Set<Permission>> getPermissionSets();  }