@@ -0,0 +1,1882 @@
+package org.xcolab.util;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Apublic class GroupingHelperTest %7B%0A%0A    private static final GroupingHelper%3CInteger%3E GROUPING_HELPER = new GroupingHelper%3C%3E(%0A            Arrays.asList(1, 2, 3));%0A%0A    @Test%0A    public void groupWithDuplicateValues() %7B%0A        Map%3CInteger, Set%3CInteger%3E%3E expected = new HashMap%3C%3E();%0A        expected.put(0, new HashSet%3C%3E(Collections.singletonList(1)));%0A        expected.put(1, new HashSet%3C%3E(Arrays.asList(1, 2)));%0A        expected.put(2, new HashSet%3C%3E(Arrays.asList(2, 3)));%0A        expected.put(3, new HashSet%3C%3E(Collections.singletonList(3)));%0A%0A        final Map%3CInteger, Set%3CInteger%3E%3E result =%0A                GROUPING_HELPER.groupWithDuplicateKeysAndValues(%0A                        number -%3E Arrays.asList(number, number -1));%0A        Assert.assertEquals(%22Unexpected map contents%22, expected, result);%0A    %7D%0A%0A    @Test%0A    public void groupWithDuplicateKeysAndValues() %7B%0A        Map%3CInteger, Set%3CInteger%3E%3E expected = new HashMap%3C%3E();%0A        expected.put(0, new HashSet%3C%3E(Collections.singletonList(1)));%0A        expected.put(1, new HashSet%3C%3E(Arrays.asList(2, 3)));%0A%0A        final Map%3CInteger, Set%3CInteger%3E%3E result =%0A                GROUPING_HELPER.groupWithDuplicateValues(number -%3E number / 2);%0A        Assert.assertEquals(%22Unexpected map contents%22, expected, result);%0A    %7D%0A%0A    @Test%0A    public void groupUnique() %7B%0A        Map%3CInteger, Integer%3E expected = new HashMap%3C%3E();%0A        expected.put(2, 1);%0A        expected.put(4, 2);%0A        expected.put(6, 3);%0A%0A        final Map%3CInteger, Integer%3E result =%0A                GROUPING_HELPER.groupUnique(number -%3E number * 2);%0A        Assert.assertEquals(%22Unexpected map contents%22, expected, result);%0A    %7D%0A%7D%0A

Add basic tests for grouping helper