HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
// // if (userIds.size() > 1 && !optionalPersonId.isEmpty()) {
// // throw new IllegalArgumentException("Cannot fetch personIds for multiple userIds");
// // }
CollectionOptions options = new CollectionOptions(request);
//// if (userIds.size() == 1) {
if (optionalPersonId.isEmpty()) {
if (groupId.getType() == GroupId.Type.self) {
// If a filter is set then we have to call getPeople(), otherwise use the simpler getPerson()
if (options != null && options.getFilter() != null) {
Future<RestfulCollection<Person>> people = personService.getPeople(
userIds, groupId, options, fields, request.getToken());
return FutureUtil.getFirstFromCollection(people);
} else {
return personService.getPerson(userIds.iterator().next(), fields, request.getToken());