@Test
public void testGroupByCustomEquality() {

    final AEquality equality = new AEquality() {
        @Override public boolean equals(Object o1, Object o2) {
            return ((Integer)o1)%2 == ((Integer)o2)%2;
        }
        @Override public int hashCode(Object o) {
            return 0;
        }
    };
    final AFunction1NoThrow<String, Integer> len = new AFunction1NoThrow<String, Integer>() {
        @Override public Integer apply(String param) {
            return param.length();
        }
    };
    final Map<AEqualsWrapper<Integer>, List<String>> grouped = ACollectionHelper.groupBy(Arrays.asList("a", "bc", "d", "efg", "hi", "j"), len, equality);
    assertEquals(2, grouped.size ());
    assertEquals(Arrays.asList("a", "d", "efg", "j"), grouped.get(new AEqualsWrapper<>(equality, 1)));
    assertEquals(Arrays.asList("bc", "hi"),           grouped.get(new AEqualsWrapper<>(equality, 2)));
}