### Question:
IdentityServiceInitializer { static Stream<PermittableGroup> getPermittableGroups(final @Nonnull List<PermittableEndpoint> permittables) { final Map<String, Set<PermittableEndpoint>> groupedPermittables = new HashMap<>(); permittables.forEach(x -> groupedPermittables.computeIfAbsent(x.getGroupId(), y -> new LinkedHashSet<>()).add(x)); return groupedPermittables.entrySet().stream() .map(entry -> new PermittableGroup(entry.getKey(), new ArrayList<PermittableEndpoint>(entry.getValue()))); } @Autowired  IdentityServiceInitializer(
      final IdentityListener identityListener,
      final ApplicationCallContextProvider applicationCallContextProvider,
      final HashGenerator hashGenerator,
      @Qualifier(ProvisionerConstants.LOGGER_NAME) final Logger logger,
      final SystemProperties systemProperties); IdentityServiceInitializationResult initializeIsis(
          final @Nonnull String tenantIdentifier,
          final @Nonnull String applicationName,
          final @Nonnull String identityManagerUri); List<EventExpectation> postApplicationPermittableGroups(
          final @Nonnull String tenantIdentifier,
          final @Nonnull String identityManagerApplicationName,
          final @Nonnull String identityManagerApplicationUri,
          final @Nonnull String applicationUri); void postApplicationDetails(
          final @Nonnull String tenantIdentifier,
          final @Nonnull String identityManagerApplicationName,
          final @Nonnull String identityManagerApplicationUri,
          final @Nonnull String applicationName,
          final @Nonnull String applicationUri,
          final @Nonnull ApplicationSignatureSet applicationSignatureSet);  }### Answer:
@Test public void getPermittableGroups() throws Exception { final List<PermittableEndpoint> permittableEndpoints = Arrays.asList(abcPost1, abcGet1, defGet1, abcPost2, abcGet2, defGet2, defGet3); final List<PermittableGroup> ret = IdentityServiceInitializer.getPermittableGroups(permittableEndpoints).collect(Collectors.toList()); Assert.assertEquals(ret, Arrays.asList(group1, group2, group3)); }
@Test public void getPermittableGroupsOnEmptyList() throws Exception { final List<PermittableGroup> ret = IdentityServiceInitializer.getPermittableGroups(Collections.emptyList()).collect(Collectors.toList()); Assert.assertEquals(ret, Collections.emptyList()); }