Java 8 Stream flatMap and group by code compiler error
问题 // given a set of Item objects, group them by the managers of creator and owners Map<String, List<Item>> managersItems = itemSet.parallelStream().flatMap(item -> { // get the list of the creator and owners List<String> users = new ArrayList(); users.add(item.getCreator()); users.addAll(item.getOwners()); return Stream.of(users.toArray(new String[] {})).map(user -> { LdapUserInfo ldapUser = LdapUserInfoFactory.create(user); String manager = ldapUser.getManager(); return new AbstractMap