Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RichIterable.groupByAndCollect(). #47

Closed
nikhilnanivadekar opened this issue Feb 9, 2016 · 3 comments
Closed

Implement RichIterable.groupByAndCollect(). #47

nikhilnanivadekar opened this issue Feb 9, 2016 · 3 comments

Comments

@nikhilnanivadekar
Copy link
Contributor

Refer to discussion on pull request 37 for more information. Also, please use the most up-to-date name decided.

@nikhilnanivadekar nikhilnanivadekar changed the title Implement RichIterable.groupByCollect(Iterable<T> iterable, Function<? super T, ? extends K> groupByFunction, Function<? super T, ? extends V> collectFunction) Implement RichIterable.groupByCollect(Iterable<T> iterable, Function<? super T, ? extends K> groupByFunction, Function<? super T, ? extends V> collectFunction). Feb 9, 2016
@motlin
Copy link
Contributor

motlin commented Feb 10, 2016

Full signature:

public <K, V> Multimap<K, V> groupByAndCollect(
    Function<? super T, ? extends K> groupByFunction,
    Function<? super T, ? extends V> collectFunction)

@motlin motlin changed the title Implement RichIterable.groupByCollect(Iterable<T> iterable, Function<? super T, ? extends K> groupByFunction, Function<? super T, ? extends V> collectFunction). Implement RichIterable.groupByCollect(). Feb 10, 2016
@motlin motlin changed the title Implement RichIterable.groupByCollect(). Implement RichIterable.groupByAndCollect(). Feb 10, 2016
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 18, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 19, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 20, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 23, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 23, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
@TheLoneKing
Copy link
Contributor

I am trying to implement groupByAndCollect method on RichIterable. My test is failing with errors that looks confusing.
Here are some errors:

  1. [ERROR] ImmutableSortedBagImplTest.RichIterable_groupByAndCollect expected: org.eclipse.collections.impl.map.mutable.UnifiedMap<{false=[12, 10, 8, 6, 4], true=[11, 9, 7, 5, 3]}> but was: org.eclipse.collections.impl.map.mutable.UnifiedMap<{false=[12, 10, 8, 6, 4], true=[11, 9, 7, 5, 3]}>
  2. [ERROR] ImmutableHashBiMapInverseTest.RichIterable_groupByAndCollect expected:<{false=[8, 10, 12, 4, 6], true=[9, 11, 3, 5, 7]}> but was:<{false=[4, 6, 8, 10, 12], true=[3, 5, 7, 9, 11]}>

In case 1, both expected result and the actual result are same. But the test is still failing as if they were different.
In case 2, just the order of the elements in the collection is different. I am not sure why the test is failing because of that.
Here is my implementation and test case: TheLoneKing@8f0025f
Can someone help on how to fix the failing tests?

@motlin
Copy link
Contributor

motlin commented Jul 24, 2019 via email

TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 25, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 27, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 27, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 27, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Jul 27, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
TheLoneKing added a commit to TheLoneKing/eclipse-collections that referenced this issue Aug 11, 2019
Signed-off-by: TheLoneKing <dkumar.kovai@gmail.com>
donraab added a commit that referenced this issue Sep 17, 2019
Implement RichIterable.groupByAndCollect(). Resolves #47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants