[misc] Function to group elements in a list.
[misc] Function to group elements in a list.

Based on a result of another function being invoked on the elements.

Change-Id: I07e3efceb7da1287e7e2d7499979a177b1a02495
Reviewed-on: http://review.couchbase.org/88650
Reviewed-by: Timofey Barmin <f30bdb2be8598fcffd705a378b25da4842d6bd7b@couchbase.com>
Tested-by: Aliaksey Artamonau <ce14b1c16e0fd654f926118eb8addbec5aff4ffa@couchbase.com>
Well-Formed: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

membase/ns_server,membase/ns_server,membase/ns_server,membase/ns_server,membase/ns_server,membase/ns_server