### Question:
CollectionUtils { public static <K, V> Map<K, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends K> keyMapper) { return collection.stream().collect(Collectors.groupingBy(keyMapper)); }  static boolean isEmpty(final Collection<?> collection); static boolean isNotEmpty(final Collection<?> collection); static Map<K, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends K> keyMapper); static PairMap<L, R, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends L> leftMapper, Function<? super V, ? extends R> rightMapper); static Optional<V> matching(final Collection<V> collection, Function<V, ? extends Long> keyMapper, long value); static Optional<V> matching(final Collection<V> collection, Function<V, ? extends Integer> keyMapper, int value); static int sumByInt(Collection<Integer> collection); static long sumByLong(Collection<Long> collection);  }### Answer:
@Test public void testGroupingBy() { assertTrue(CollectionUtils.groupingBy(list, Pet::getId, Pet::getLevel).size() == MAX); }
@Test public void testGroupingBy1() { assertTrue(CollectionUtils.groupingBy(list, Pet::getId).size() == MAX); }
@Test public void testGroupingBy2() { PairMap<Integer, Integer, List<Pet>> result = CollectionUtils.groupingBy(list, Pet::getId, Pet::getLevel); assertTrue(result.size() == 20); }